mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
Bug 620767 - Typo in GSettings documentation
Use the correct variable name and work around the escaping of '@'. Expand/clarify the section on how translation of <default> is handled.
This commit is contained in:
parent
486c46b945
commit
af78f6d418
@ -322,10 +322,24 @@ gsettings_SCHEMAS = my.app.gschema.xml
|
||||
</key>
|
||||
]]>
|
||||
</programlisting>
|
||||
Note how we used the context attribute to add msgctxt - "18" is not a
|
||||
good string to look up in gettext by itself. Also note that the value
|
||||
24 is not present in the schema anymore. It has to be added to the
|
||||
gettext catalog for "be" instead.
|
||||
</para>
|
||||
<para>
|
||||
GSettings uses gettext for translation of default values.
|
||||
The string that is translated is exactly the string that appears
|
||||
inside of the <tag class='starttag'>default</tag> element. This
|
||||
includes the quotation marks that appear around strings.
|
||||
Default values must be marked with the <varname>l10n</varname>
|
||||
attribute in the <tag class='starttag'>default</tag> tag, which
|
||||
should be set as equal to <literal>'messages'</literal> or
|
||||
<literal>'time'</literal> depending on the desired category. An
|
||||
optional translation context can also be specified with the
|
||||
<varname>context</varname> attribute, as in the example. This
|
||||
is usually recommended, since the string "<literal>18</literal>"
|
||||
is not particularly easy to translate without context. The
|
||||
translated version of the default value should be stored in the
|
||||
specified <varname>gettext-domain</varname>. Care must be taken
|
||||
during translation to ensure that all translated values remain
|
||||
syntactically valid; mistakes here will cause runtime errors.
|
||||
</para>
|
||||
<para>
|
||||
GSettings schemas have optional <tag class="starttag">summary</tag> and
|
||||
@ -343,7 +357,8 @@ gsettings_SCHEMAS = my.app.gschema.xml
|
||||
extracted into your gettext catalog. One way to do that is to use
|
||||
intltool. For that, you use <tag class="starttag">_summary</tag>
|
||||
and <tag class="starttag">_description</tag> elements in a
|
||||
.gschema.xml.in file and use <literal>@INTLTOOL_XML_NOMERGE_RULE@</literal>
|
||||
.gschema.xml.in file and use
|
||||
<literal>@<!-- -->INTLTOOL_XML_NOMERGE_RULE<!-- -->@</literal>
|
||||
in your Makefile.am to produce the .gschema.xml file. The
|
||||
<literal>NOMERGE</literal> part of the rule instructs intltool
|
||||
to extract translatable strings, but not merge the translations
|
||||
|
Loading…
Reference in New Issue
Block a user