i18n in RKWard's xml files
For RKWard's XML files, i18n will mostly just work. If you are writing your own .pluginmap (e.g. for an external plugin),
you will have to specify a
po_id next to the pluginmap's
id. This defines the "message catalog" to use. In general this should
be set identical to the
id of your .pluginmap, but if you provide several .pluginmaps and want to control, how
message catalogs are divided up, this allows you to do so. The
po_id is inherited by any .pluginmap you include, unless that declares
po_id, and by all plugins declared in it.
For plugins and help pages, you do not need to tell RKWard which strings are to be translated, because that is generally evident from their usage. However, as explained above,
you should keep an eye out for strings that may be ambiguous or need some explaining in order to be translated, correctly. For strings that could have different meanings, provide
i18n_context like this:
<checkbox id="scale" label="Scale" i18n_context="Show the scale"/> <checkbox id="scale" label="Scale" i18n_context="Scale the plot"/>
i18n_context will cause the two strings to be translated separately. Otherwise they would share a single translation. In addition, the context
is shown to the translator. The
i18n_context-attribute is supported on all elements that can have translatable strings, somewhere, including elements that
contain text inside them (e.g. <text>-elements).
In other cases the string to translate has a single non-ambiguous meaning, but may still need some explaining. In this case you can add a comment that will be shown to translators. Examples might include:
<!-- i18n: No, this is not a typo for screen plot! --> <component id="scree_plot" label="Scree plot"/> <!-- i18n: If you can, please make this string short. Having more than some 15 chars looks really ugly at this point, and the meaning should be mostly self-evident to the user (selection from a list of values shown next to this element) --> <valueslot id="selected" label="Pick one"/>
Note that such comments must precede the element they apply to, and must start with either "i18n:" or "TRANSLATORS:".
Finally, in rare cases, you may want to exclude certain strings from translation. This may make sense, for example, if you offer a choice between several R function names in a <radio>-control. You do not want these to be translated, then (but depending on the context, you should consider giving a descriptive label, instead):
<radio id="transformation" label="R function to apply"> <option id="as.list" noi18n_label="as.list()"/> <option id="as.vector" noi18n_label="as.vector()"/> [...] </radio>
Note that you will omit the
label-attribute, then, and specify
noi18n_label, instead. Also, note that in contrast to
i18n_context and comments, using
noi18n_label will make your plugin incompatible with versions of RKWard prior to 0.6.3.
|Plugin translations||Up||i18n in RKWard's js files and sections|