translationgettextgsettings

Is it possible to mark GSettings/GSchema <flags> as translatable?


I have a GSchema defining some flags like so:

<flags id="org.example.program">
    <value nick="ENGLISH_WORD" value="1"/>
    <value nick="ANOTHER_WORD" value="2"/>
</flags>

However I have been informed by a translator that these are not processed by gettext or offered in the .pot file. Is there a way I can mark these as translatable?


Solution

  • The default values can be translated but the translations are substituted from .mo files at runtime. You have to put the textdomain in the attribute "gettext-domain" of the "<schemalist>" resp. "<schema>" element. You also have to put the locale category into the attribute "category" of the "<default>" element. Read the paragraph "Description" in https://developer.gnome.org/gio/stable/GSettings.html for more information.

    I recommend that you examine the sources of a recent Gtk application and see how the different components are localized. GNU gettext has recently been improved to offer better support for localizing desktop applications and therefore the process is currently evolving. In particular, you usually no longer need intltool.