mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-03 17:35:44 +02: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>
|
</key>
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
Note how we used the context attribute to add msgctxt - "18" is not a
|
</para>
|
||||||
good string to look up in gettext by itself. Also note that the value
|
<para>
|
||||||
24 is not present in the schema anymore. It has to be added to the
|
GSettings uses gettext for translation of default values.
|
||||||
gettext catalog for "be" instead.
|
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>
|
||||||
<para>
|
<para>
|
||||||
GSettings schemas have optional <tag class="starttag">summary</tag> and
|
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
|
extracted into your gettext catalog. One way to do that is to use
|
||||||
intltool. For that, you use <tag class="starttag">_summary</tag>
|
intltool. For that, you use <tag class="starttag">_summary</tag>
|
||||||
and <tag class="starttag">_description</tag> elements in a
|
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
|
in your Makefile.am to produce the .gschema.xml file. The
|
||||||
<literal>NOMERGE</literal> part of the rule instructs intltool
|
<literal>NOMERGE</literal> part of the rule instructs intltool
|
||||||
to extract translatable strings, but not merge the translations
|
to extract translatable strings, but not merge the translations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user