Commit af78f6d4 authored by Allison Karlitskaya's avatar Allison Karlitskaya

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.
parent 486c46b9
......@@ -322,10 +322,24 @@ gsettings_SCHEMAS =
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.
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.
GSettings schemas have optional <tag class="starttag">summary</tag> and
......@@ -343,7 +357,8 @@ gsettings_SCHEMAS =
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 file and use <literal>&commat;INTLTOOL_XML_NOMERGE_RULE&commat;</literal> file and use
<literal>@<!-- -->INTLTOOL_XML_NOMERGE_RULE<!-- -->@</literal>
in your 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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment