[libcalamares] Document how TranslatedString context works
- Support re-using class-specific tr() calls in a standard way - Document this in the netinstall.conf which uses it
This commit is contained in:
parent
a03394f177
commit
81752b6f7c
@ -39,6 +39,17 @@ class DLLEXPORT TranslatedString
|
||||
{
|
||||
public:
|
||||
/** @brief Get all the translations connected to @p key
|
||||
*
|
||||
* Gets map[key] as the "untranslated" form, and then all the
|
||||
* keys of the form <key>[lang] are taken as the translation
|
||||
* for <lang> of the untranslated form.
|
||||
*
|
||||
* If @p context is not a nullptr, then that is taken as an
|
||||
* indication to **also** use the regular QObject::tr() translation
|
||||
* mechanism for these strings. It is recommended to pass in
|
||||
* metaObject()->className() as context (from a QObject based class)
|
||||
* to give the TranslatedString the same context as other calls
|
||||
* to tr() within that class.
|
||||
*/
|
||||
TranslatedString( const QVariantMap& map, const QString& key, const char* context = nullptr );
|
||||
/** @brief Not-actually-translated string.
|
||||
|
@ -30,8 +30,14 @@ required: false
|
||||
# If no *sidebar* values are provided, defaults to "Package selection"
|
||||
# and existing translations. If no *title* values are provided, no string
|
||||
# is displayed.
|
||||
#
|
||||
# The following strings are already known to Calamares and can be
|
||||
# listed here in *untranslated* form (e.g. as value of *sidebar*)
|
||||
# without bothering with the translations: they are picked up from
|
||||
# the regular translation framework:
|
||||
# - "Package selection"
|
||||
label:
|
||||
sidebar: "Package selection"
|
||||
sidebar[nl]: "Pakketkeuze"
|
||||
title: "Office Package"
|
||||
title[nl]: "Kantoorsoftware"
|
||||
# sidebar[nl]: "Pakketkeuze"
|
||||
# title: "Office Package"
|
||||
# title[nl]: "Kantoorsoftware"
|
||||
|
Loading…
Reference in New Issue
Block a user