home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gnome / help / gnome-doc-xslt / C / translating.xml < prev   
Encoding:
Extensible Markup Language  |  2009-03-17  |  31.6 KB  |  681 lines

  1. <?xml version="1.0" encoding="utf-8"?><!-- -*- indent-tabs-mode: nil -*- -->
  2. <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY intltool "<command>intltool</command>">
  5. <!ENTITY gettext_xsl "<filename>gettext.xsl</filename>">
  6. <!ENTITY l10n_xml "<filename>l10n.xml</filename>">
  7. <!ENTITY l10n_gettext
  8.   "<function role='xsl-template' moreinfo='refentry'>l10n.gettext</function>">
  9. <!ENTITY l10n_plural_form
  10.   "<function role='xsl-template' moreinfo='refentry'>l10n.plural.form</function>">
  11. <!ENTITY xrefstyle
  12.   "<sgmltag class='attribute'>xrefstyle</sgmltag>">
  13. ]>
  14.  
  15. <section id="translating">
  16.   <title>Translating the Stylesheets</title>
  17.   <para>The Gnome documentation stylesheets provide support for localizing
  18.   the rendered output from DocBook documents.  Localizable strings in the
  19.   stylesheets are marked for translation and extracted into PO files and
  20.   &intltool;.  After they have been translated, &intltool; merges them into
  21.   an XML file called &l10n_xml;, which is then used by the stylesheets to
  22.   localize the output.</para>
  23.  
  24.   <para>Providing full internationalization support for the DocBook stylesheets
  25.   is not trivial, and providing localizations requires translators to understand
  26.   how documents are formatted and, to some extent, how DocBook works.  DocBook
  27.   is a high-level markup language, and it requires processing applications to
  28.   provide much of the formatting for documents.  DocBook applications must
  29.   resolve cross references, create tables of contents, format headers, and
  30.   perform other formatting tasks that need to be localized.  Localizing these
  31.   tasks involves more than translating stand-alone sentences.  In effect, the
  32.   very formatting code itself is localizable.</para>
  33.  
  34.   <note>
  35.     <title>Help Us Help You</title>
  36.     <para>Document formatting varies greatly across the world.  Each locale has
  37.     a long history of formatting conventions and methods.  The maintainers of
  38.     these stylesheets do not know all the nuances of formatting documents in
  39.     all locales.  The only way we can create better output for your locale is
  40.     if you tell us when you encounter problems.</para>
  41.   </note>
  42.  
  43.   <para>Although all localization is done by translating strings in a PO file,
  44.   there are many cases where the translatable string is not a simple sentence
  45.   or phrase.  Rather, translators must provide data using XML fragments.  These
  46.   structured fragments can be used to work with plural forms, provide alternative
  47.   formattings based on context, or provide format strings.</para>
  48.  
  49.   <section id="translating-simple">
  50.     <title>Simple Strings</title>
  51.  
  52.     <para>Translated strings are extracted in the stylesheets by a template
  53.     called &l10n_gettext;.  This template extracts strings from an XML file,
  54.     which is built from PO files by &intltool;.  For example, consider the
  55.     string <wordasword>Caution</wordasword>, which is used as a heading for
  56.     <sgmltag>caution</sgmltag> elements.  The stylesheets would call
  57.     &l10n_gettext; to extract the translated value of this string for
  58.     the document's language.  The &l10n_xml; file would have an entry
  59.     similar to this:</para>
  60.  
  61.     <programlisting><![CDATA[
  62. <msgset xmlns=""http://www.gnome.org/~shaunm/gnome-doc-utils/l10n">
  63.   <msgid>Caution</msgid>
  64.   <msg>Caution</msg>
  65.   <msg xml:lang="ar">ÿ•ŸÜÿ™ÿ®ÿߟá</msg>
  66.   <msg xml:lang="bg">–í–Ω–∏–º–∞–Ω–∏–µ</msg>
  67.   <msg xml:lang="ca">Compte</msg>
  68.   <msg xml:lang="cs">Upozornƒõn√≠</msg>
  69.   <msg xml:lang="da">Forsigtig</msg>
  70.   <msg xml:lang="de">Achtung</msg>
  71.   <msg xml:lang="el">Œ†œÅŒøœÉŒøœáŒÆ</msg>
  72.   <msg xml:lang="en_CA">Caution</msg>
  73.   <msg xml:lang="en_GB">Caution</msg>
  74.   <msg xml:lang="es">Precauci√≥n</msg>
  75.   <msg xml:lang="et">Ettevaatust</msg>
  76.   <msg xml:lang="fi">Varoitus</msg>
  77.   <msg xml:lang="fr">Attention</msg>
  78.   <msg xml:lang="gu">‡™∏‡™æ‡™µ‡™ß‡™æ‡™®</msg>
  79.   <msg xml:lang="hi">‡§ö‡•ᇧ§‡§æ‡§µ‡§®‡•Ä</msg>
  80.   <msg xml:lang="hu">Figyelem</msg>
  81.   <msg xml:lang="id">Perhatian</msg>
  82.   <msg xml:lang="it">Attenzione</msg>
  83.   <msg xml:lang="ja">Ê≥®ÊÑè</msg>
  84.   <msg xml:lang="ko">Ï£ºÏùò</msg>
  85.   <msg xml:lang="lt">ƒÆspƒójimas</msg>
  86.   <msg xml:lang="nb">Advarsel</msg>
  87.   <msg xml:lang="ne">‡§∏‡§æ‡§µ‡§ß‡§æ‡§®‡•Ä</msg>
  88.   <msg xml:lang="nl">Let op</msg>
  89.   <msg xml:lang="no">Advarsel</msg>
  90.   <msg xml:lang="pa">‡®∏‡®æ‡®µ‡®ß‡®æ‡®®</msg>
  91.   <msg xml:lang="pt">Cuidado</msg>
  92.   <msg xml:lang="pt_BR">Cuidado</msg>
  93.   <msg xml:lang="ro">Aten≈£ie</msg>
  94.   <msg xml:lang="sk">V√Ωstraha</msg>
  95.   <msg xml:lang="sq">Kujdes</msg>
  96.   <msg xml:lang="sr">–ü–∞–∂—ö–∞</msg>
  97.   <msg xml:lang="sr@Latn">Pa≈ænja</msg>
  98.   <msg xml:lang="sv">Varning</msg>
  99.   <msg xml:lang="tr">Uyarƒ±</msg>
  100.   <msg xml:lang="uk">–ó–∞—Å—Ç–µ—Ä–µ–∂–µ–Ω–Ω—è</msg>
  101.   <msg xml:lang="vi">C·∫£nh b√°o</msg>
  102.   <msg xml:lang="wa">Adviertance</msg>
  103.   <msg xml:lang="zh_CN">Â∞èÂøÉ</msg>
  104.   <msg xml:lang="zh_TW">Ê≥®ÊÑè</msg>
  105. </msgset>]]></programlisting>
  106.  
  107.     <para>Translators, however, will work only with the PO files.  Using
  108.     PO files for these strings is no different than any other simple string
  109.     translation.  The PO entry in the <literal>sr</literal> locale for the
  110.     above string would look like this:</para>
  111.  
  112.     <programlisting><![CDATA[
  113. #: ../xslt/gettext/l10n.xml.in.h:1347
  114. msgid "Caution"
  115. msgstr "–ü–∞–∂—ö–∞"]]></programlisting>
  116.   </section>
  117.  
  118.   <section id="translating-plurals">
  119.     <title>Plurals</title>
  120.  
  121.     <para>In many cases, a static string is insufficient for proper localized
  122.     content.  For these cases, the stylesheets allow for alternate strings by
  123.     placing the strings in a structured XML fragment.  Alternate strings are
  124.     used in two ways: to provide plural forms according to the plural rules
  125.     of the language, and to provide alternate formattings based on a specified
  126.     role.  This section discusses plurals.  See <xref linkend="translating-roles"/>
  127.     for a discussion of roles.</para>
  128.  
  129.     <para>Plural forms are handled similarly to how they are handled in other
  130.     applications.  A rule is provided to transform a number into a plural index,
  131.     and a translation is provided for each of those indexes.  Unfortunately,
  132.     there is no standard way to encode this information into XML; thus, there
  133.     is no mechanism in &intltool;'s XML mode.  Consequently, translators must
  134.     place their translations in an XML fragment.  This fragment is merged into
  135.     the &l10n_xml; file, and the stylesheets extract the appropriate form.</para>
  136.  
  137.     <para>Here is an example entry in the &l10n_xml; file:</para>
  138.  
  139.     <programlisting><![CDATA[
  140. <msgset xmlns=""http://www.gnome.org/~shaunm/gnome-doc-utils/l10n">
  141.   <msgid>Author</msgid>
  142.   <msg>
  143.     <msgstr form='0'>Author</msgstr>
  144.     <msgstr form='1'>Authors</msgstr>
  145.   </msg>
  146.   <msg xml:lang="sr">
  147.     <msgstr form='0'>–ê—É—Ç–æ—Ä</msgstr>
  148.     <msgstr form='1'>–ê—É—Ç–æ—Ä–∏</msgstr>
  149.     <msgstr form='2'>–ê—É—Ç–æ—Ä–∏</msgstr>
  150.   </msg>
  151. </msgset>]]></programlisting>
  152.  
  153.     <para>Since the Serbian language has three plural forms, three translations
  154.     have been provided.  Each of these is placed in a <sgmltag>msgstr</sgmltag>
  155.     element, and the <sgmltag role="attribute">form</sgmltag> attribute is used
  156.     to indicate for which plural form they are used.</para>
  157.  
  158.     <para>Again, translators will only see the entries in their PO files.  The
  159.     PO file entry for the above translation looks like this:</para>
  160.  
  161.     <programlisting><![CDATA[
  162. #. Used as a header before a list of authors.
  163. #: ../xslt/gettext/l10n.xml.in.h:1310
  164. msgid ""
  165. "<msgstr form='0'>Author</msgstr> "
  166. "<msgstr form='1'>Authors</msgstr>"
  167. msgstr ""
  168. "<msgstr form='0'>–ê—É—Ç–æ—Ä</msgstr>\n"
  169. "<msgstr form='1'>–ê—É—Ç–æ—Ä–∏</msgstr>\n"
  170. "<msgstr form='2'>–ê—É—Ç–æ—Ä–∏</msgstr>"
  171. ]]></programlisting>
  172.  
  173.     <para>Since <command>intltool</command> often alters whitespace, the
  174.     entry in the PO file might not look as nice as this.  When creating the
  175.     translated message strings, translators may add or remove whitespace
  176.     between <sgmltag>msgstr</sgmltag> elements if they choose.  This extra
  177.     text content is ignored by &l10n_gettext;.</para>
  178.  
  179.     <para>Note that translators may add a <sgmltag>msgstr</sgmltag> element
  180.     without a <sgmltag class="attribute">form</sgmltag> attribute as a fallback
  181.     translation.  In the example above, the last two <sgmltag>msgstr</sgmltag>
  182.     elements could have been replaced by a single <sgmltag>msgstr</sgmltag>
  183.     element without a <sgmltag class="attribute">form</sgmltag> attribute.
  184.     The &l10n_gettext; template would match the first element whenever the
  185.     plural form is 0, and the fallback element otherwise.</para>
  186.  
  187.     <para>The plural form is selected using the &l10n_plural_form; template.
  188.     This templates takes the number of items as a parameter, and returns the
  189.     numeric index of the plural form to use.  Currently, the rule cannot be
  190.     automatically extracted from the <literal>Plural-Forms</literal> entry
  191.     in the PO file, though this feature is planned for the future.  Until
  192.     this feature is added, plural rules have to be coded manually in the
  193.     stylesheets.  Translators need to notify the maintainers when they
  194.     begin translating the stylesheets.</para>
  195.   </section>
  196.  
  197.   <section id="translating-roles">
  198.     <title>Roles</title>
  199.  
  200.     <para>In many cases, how to render an element depends on various
  201.     conditions, such as the grammatical role.  For these cases, the
  202.     stylesheets allow translators to provide multiple translations,
  203.     each marked with a <sgmltag role="attribute">role</sgmltag>
  204.     attribute from a fixed vocabulary.  The list of valid roles will
  205.     depend on the template, and should be given in the translator
  206.     comment accompanying each string.  However, there are a number
  207.     of common cases, particularly for labels and cross references.
  208.     </para>
  209.  
  210.     <para>Translating using roles is similar to translating using plural
  211.     forms.  A translation consists of any number of <sgmltag>msgstr</sgmltag>
  212.     elements, each with a <sgmltag class="attribute">role</sgmltag> attribute.
  213.     A <sgmltag>msgstr</sgmltag> element without an attribute can be provided
  214.     as a default if none of the roles match.</para>
  215.  
  216.     <para>For example, the <sgmltag>citetitle</sgmltag> element in DocBook
  217.     is used to cite the title of a publication.  The type of the publication
  218.     is specified in the <sgmltag class="attribute">class</sgmltag> attribute.
  219.     In many English publications, article titles are placed in quotes, while
  220.     book titles are italicized.  The following fragment will quote article
  221.     titles, but italicize all other cited titles.</para>
  222.  
  223.     <programlisting><![CDATA[
  224. <msgstr role='article'>‚Äú<node/>‚Äù</msgstr>
  225. <msgstr><i><node/></i></msg:msgstr>
  226. ]]></programlisting>
  227.  
  228.     <para>The Serbian translation team has chosen to follow the same
  229.     convention of quoting article titles and italicizing all others.
  230.     The entry in <filename>sr.po</filename> follows.</para>
  231.  
  232.     <programlisting><![CDATA[
  233. #: ../xslt/gettext/l10n.xml.in.h:304
  234. msgid ""
  235. "<msgid>citetitle.format</msgid> "
  236. "<msgstr role='article'>‚Äú<node/>‚Äù</msgstr> "
  237. "<msgstr><i><node/></i></msgstr>"
  238. msgstr ""
  239. "<msgstr role='article'>‚Äû<node/>‚Äú</msgstr>\n"
  240. "<msgstr><i><node/></i></msgstr>"
  241. ]]></programlisting>
  242.  
  243.     <para>The meaning of the markup inside the <sgmltag>msgstr</sgmltag>
  244.     elements will be explained in <xref linkend="translating-formats"/>.
  245.     For now, simply note that multiple strings have been provided, each
  246.     in a <sgmltag>msgstr</sgmltag> element.  The only difference between
  247.     the original string and the Serbian string is that Serbian is using
  248.     a different opening quote character, aligned at the baseline.</para>
  249.  
  250.     <para>Note also that the original translation contains an additional
  251.     <sgmltag>msgid</sgmltag> element.  This element is redundant in the
  252.     merged XML; its only purpose is to distinguish the string from other
  253.     strings, which may potentially have the same formatting in English.
  254.     Redundant <sgmltag>msgid</sgmltag> elements are sometimes used even
  255.     when neither plural forms nor roles are being used.  In those cases,
  256.     the sole translatable string is placed in a <sgmltag>msgstr</sgmltag>
  257.     element with no attributes.</para>
  258.   </section>
  259.  
  260.   <section id="translating-formats">
  261.     <title>Format Strings</title>
  262.  
  263.     <para>Using specialized format strings, the Gnome documentation stylesheets
  264.     can translate more than just simple strings.  These format strings are
  265.     similar in principle to format strings used in C programs, except that
  266.     XML is used to insert named parameters, rather than special format tokens
  267.     being used to insert positional parameters.</para>
  268.  
  269.     <para>For instance, DocBook provides the <sgmltag>quote</sgmltag> element,
  270.     used to mark inline quotations. How to render an inline quotation depends
  271.     on the typographic conventions of the language.  In U.S. English, they are
  272.     rendered inside ‚Äúdouble inverted-comma‚Äù quotation marks.  In Serbian, they
  273.     are typically rendered with the opening quotation ‚Äûaligned at the baseline‚Äú.
  274.     The entry in the Serbian PO file for this format string follows.</para>
  275.  
  276.     <programlisting><![CDATA[
  277. #: ../xslt/gettext/l10n.xml.in.h:936
  278. msgid ""
  279. "<msgid>quote.format</msgid> "
  280. "<msgstr role='inner'>‚Äò<node/>‚Äô</msgstr> "
  281. "<msgstr>“<node/>”</msgstr>"
  282. msgstr ""
  283. "<msgstr role='inner'>‚Äò<node/>‚Äô</msgstr>\n"
  284. "<msgstr>„<node/>”</msgstr>"
  285. ]]></programlisting>
  286.  
  287.     <para>Multiple <sgmltag>msgstr</sgmltag> elements have been provided
  288.     with roles.  These are used to distinguish inner quotes from outer
  289.     quotes.  Roles were described in <xref linkend="translating-roles"/>.
  290.     The <sgmltag>msgstr</sgmltag> elements also contain inline markup.
  291.     This markup is used to insert additional content.  In this case,
  292.     only the <sgmltag class="emptytag">node</sgmltag> element has been
  293.     used.  This element is replaced by the contents of the quotation
  294.     element being processed.</para>
  295.  
  296.     <para>Each format string has a set number of named arguments available.
  297.     These arguments should be documented in the translator comments that
  298.     accompany the string.  Note that the default translation may not make
  299.     use of all the available arguments.</para>
  300.  
  301.     <para>In addition to marker elements in format strings, translators
  302.     may also use simple inline formatting markup.  Any content can be
  303.     wrapped in a <sgmltag>span</sgmltag> element with certain attributes
  304.     to control formatting.  The attributes are a subset of CSS properties.
  305.     For HTML output, they are converted directly into the corresponding
  306.     CSS.  The list of allowed attributes is as follows:</para>
  307.  
  308.     <variablelist>
  309.       <varlistentry>
  310.         <term><sgmltag>font-family</sgmltag></term>
  311.         <listitem><para>This attribute sets the font family.  Specifying
  312.         exact font is generally a not advisable.  Rather, this should be
  313.         used to provide a generic family: serif, sans-serif, cursive,
  314.         fantasy, or monospace.</para></listitem>
  315.       </varlistentry>
  316.       <varlistentry>
  317.         <term><sgmltag>font-style</sgmltag></term>
  318.         <listitem><para>This attribute can be used to italicize the text.
  319.         The allowed values are italic, oblique, and normal.</para></listitem>
  320.       </varlistentry>
  321.       <varlistentry>
  322.         <term><sgmltag>font-variant</sgmltag></term>
  323.         <listitem><para>This attribute can be used to set the text in small
  324.         caps.  Small caps prints lowercase letters with smaller versions of
  325.         the uppercase glyphs.  The allowed values are small-caps and normal.
  326.         </para></listitem>
  327.       </varlistentry>
  328.       <varlistentry>
  329.         <term><sgmltag>font-weight</sgmltag></term>
  330.         <listitem><para>This attribute can be used to mark the text bold.
  331.         CSS allows any number from 100 to 900, with normal text being 400
  332.         and bold being 700.  In addition to numerical values, you can use
  333.         one of bold, bolder, lighter, or normal to use pre-defined values.
  334.         Only bold and normal should generally be needed.</para></listitem>
  335.       </varlistentry>
  336.       <varlistentry>
  337.         <term><sgmltag>font-stretch</sgmltag></term>
  338.         <listitem><para>This attribute can be used to stretch or condense
  339.         the font.  CSS allows a number of keywords to specify by exactly
  340.         how much to stretch the font.  In practice, only wider, narrower,
  341.         and normal should generally be used.</para></listitem>
  342.       </varlistentry>
  343.       <varlistentry>
  344.         <term><sgmltag>font-size</sgmltag></term>
  345.         <listitem><para>This attribute sets the size of the font.  CSS
  346.         allows both absolute font sizes using keywords or numeric lenghts,
  347.         as well as relative font sizes using keywords or percentages.
  348.         Generally, only larger, smaller, and normal should be used for
  349.         this attribute.  Better, use the <sgmltag>big</sgmltag> and
  350.         <sgmltag>small</sgmltag> convenience elements described below.
  351.         They are defined to respect the size scales used throughout the
  352.         stylesheets.</para></listitem>
  353.       </varlistentry>
  354.       <varlistentry>
  355.         <term><sgmltag>text-decoration</sgmltag></term>
  356.         <listitem><para>This attribute can set various effects on the text.
  357.         The allowed values are none, underline, overline, line-through,
  358.         and blink.  Don't use blink.</para></listitem>
  359.       </varlistentry>
  360.     </variablelist>
  361.  
  362.     <para>Additionally, extra inline elements are provided for convenience.
  363.     The formatting done by these elements could also be done using the
  364.     <sgmltag>span</sgmltag> element.  Using these elements is just easier
  365.     for common formatting tasks.</para>
  366.  
  367.     <variablelist>
  368.       <varlistentry>
  369.         <term><sgmltag>big</sgmltag></term>
  370.         <listitem><para>Make the text larger.  This is preferred over using
  371.         the <sgmltag>font-size</sgmltag> attribute, because it is defined to
  372.         use the size scale used throughout the stylesheets.</para></listitem>
  373.       </varlistentry>
  374.       <varlistentry>
  375.         <term><sgmltag>small</sgmltag></term>
  376.         <listitem><para>Make the text smaller.  This is preferred over using
  377.         the <sgmltag>font-size</sgmltag> attribute, because it is defined to
  378.         use the size scale used throughout the stylesheets.</para></listitem>
  379.       </varlistentry>
  380.       <varlistentry>
  381.         <term><sgmltag>sub</sgmltag></term>
  382.         <listitem><para>Render the text as a subscript.</para></listitem>
  383.       </varlistentry>
  384.       <varlistentry>
  385.         <term><sgmltag>sup</sgmltag></term>
  386.         <listitem><para>Render the text as a superscript.</para></listitem>
  387.       </varlistentry>
  388.       <varlistentry>
  389.         <term><sgmltag>b</sgmltag></term>
  390.         <listitem><para>Make the text bold.  This is equivalent to setting
  391.         the <sgmltag>font-weight</sgmltag> attribute to bold.</para></listitem>
  392.       </varlistentry>
  393.       <varlistentry>
  394.         <term><sgmltag>i</sgmltag></term>
  395.         <listitem><para>Make the text italic.  This is equivalent to setting
  396.         the <sgmltag>font-style</sgmltag> attribute to italic.</para></listitem>
  397.       </varlistentry>
  398.       <varlistentry>
  399.         <term><sgmltag>tt</sgmltag></term>
  400.         <listitem><para>Make the text monospace.  This is equivalent to setting
  401.         the <sgmltag>font-family</sgmltag> attribute to monospace.</para></listitem>
  402.       </varlistentry>
  403.       <varlistentry>
  404.         <term><sgmltag>u</sgmltag></term>
  405.         <listitem><para>Underline the text.  This is equivalent to setting the
  406.         <sgmltag>text-decoration</sgmltag> attribute to underline.</para></listitem>
  407.       </varlistentry>
  408.     </variablelist>
  409.  
  410.   </section>
  411.  
  412.   <section id="translating-types">
  413.     <title>Common Formatter Types</title>
  414.  
  415.     <para>There are a number of common types of format strings that are
  416.     marked for translation in the stylesheets.  DocBook contains a lot
  417.     of structural markup, and many of the same sorts of formatting tasks
  418.     have to be performed on different elements.  For example, chapters,
  419.     appendixes, and sections all have similar formatting needs, but they
  420.     usually need to be handled distinctly.  The stylesheets do not expose
  421.     every distinct element of DocBook; rather, they only make distinctions
  422.     when they matter from a document presentation viewpoint.</para>
  423.  
  424.     <para>This section outlines many of the common types of strings
  425.     translators will encounter.  Strings of the same type will generally
  426.     have the same format arguments and the same set of roles.</para>
  427.  
  428.     <section id="translating-types-labels">
  429.       <title>Label Formatters</title>
  430.       <para>Labels are used before titles in headers and contents listings.
  431.       Usually, a label will contain the object's number followed by some
  432.       punctuation.  Formal block objects, such as tables and figures,
  433.       often have more information in the label.</para>
  434.  
  435.       <para>The Serbian label formatters for sections and figures follow.</para>
  436.  
  437.       <programlisting><![CDATA[
  438. #: ../xslt/gettext/l10n.xml.in.h:1128
  439. msgid ""
  440. "<msgid>section.label</msgid> "
  441. "<msgstr role='header'><number/>. </msgstr> "
  442. "<msgstr role='li'><number/>. </msgstr> "
  443. "<msgstr>Section <number/></msgstr>"
  444. msgstr ""
  445. "<msgstr role='header'><number/>. </msgstr>\n"
  446. "<msgstr role='li'><number/>. </msgstr>\n"
  447. "<msgstr>–û–¥–µ—ô–∞–∫ <number/></msgstr>"
  448.  
  449. #: ../xslt/gettext/l10n.xml.in.h:492
  450. msgid ""
  451. "<msgid>figure.label</msgid> "
  452. "<msgstr role='header'><i>Figure <number/></i> </msgstr> "
  453. "<msgstr role='li'>Figure <number/> </msgstr> "
  454. "<msgstr>Figure <number/></msgstr>"
  455. msgstr ""
  456. "<msgstr role='header'><i>–°–ª–∏–∫–∞ <number/></i> </msgstr>\n"
  457. "<msgstr role='li'>–°–ª–∏–∫–∞ <number/> </msgstr>\n"
  458. "<msgstr>–°–ª–∏–∫–∞ <number/></msgstr>"
  459. ]]></programlisting>
  460.  
  461.       <para>In both cases, translations are provided for the
  462.       <literal>header</literal> and <literal>li</literal> roles.
  463.       Additionally, a fallback formatting has been provided to format
  464.       labels when no role is provided.  Label formatters will generally
  465.       use the same two roles.  Fallback translations should be provided
  466.       as well.</para>
  467.  
  468.       <para>Most label formatters provide three format arguments which
  469.       can be used in the translations:</para>
  470.  
  471.       <variablelist>
  472.         <varlistentry>
  473.           <term><sgmltag class="emptytag">title</sgmltag></term>
  474.           <listitem><para>Insert the title of the element being labeled.
  475.           For most types of element, the title is simply provided by the
  476.           <sgmltag>title</sgmltag> in DocBook.  A few DocBook elements,
  477.           notably <sgmltag>refentry</sgmltag>, have more complicated
  478.           content models.  Translators need only reference the argument,
  479.           and the stylesheets will determine the title.</para></listitem>
  480.         </varlistentry>
  481.         <varlistentry>
  482.           <term><sgmltag class="emptytag">titleabbrev</sgmltag></term>
  483.           <listitem><para>Insert the abbreviated title of the element
  484.           being labeled.  Abbreviated titles are provided by the
  485.           <sgmltag>titleabbrev</sgmltag> element in DocBook.  If the
  486.           labeled element does not have an abbreviated title, the
  487.           title is used instead.</para></listitem>
  488.         </varlistentry>
  489.         <varlistentry>
  490.           <term><sgmltag class="emptytag">number</sgmltag></term>
  491.           <listitem><para>Insert the fully qualified number of the element
  492.           being labeled.  For most label formatters, there is a corresponding
  493.           number formatter that will be called for this argument.</para></listitem>
  494.         </varlistentry>
  495.       </variablelist>
  496.  
  497.       <para>Since labels are used before titles, most label formatters should
  498.       only need to use the number of the element.</para>
  499.     </section>
  500.  
  501.     <section id="translating-types-numbers">
  502.       <title>Number Formatters</title>
  503.       <para>Numbers are used in labels, cross references, and other identifiers.
  504.       Numbers identify elements by their position in the document.  Numbers can
  505.       be as simple as single-level positions, or they may indicate a hierarchy.
  506.       For example, the third subsection of the fourth section in the second
  507.       chapter would be Section 2.4.3.  The job of number formatters is to put
  508.       together the hierarchical number string.  Thus, number formatters are not
  509.       called for single-level numbers.</para>
  510.  
  511.       <para>The single-level number of an element in its parent is referred to
  512.       as that element's <firstterm>digit</firstterm>.  Number formatters work
  513.       by specifying how to combine the parent element's number with the current
  514.       element's digit.  Two format arguments are allowed:</para>
  515.  
  516.       <variablelist>
  517.         <varlistentry>
  518.           <term><sgmltag class="emptytag">parent</sgmltag></term>
  519.           <listitem><para>Insert the fully qualified number of the element's
  520.           parent.  In many cases, this number is constructed by calling the
  521.           number formatter for the parent element.</para></listitem>
  522.         </varlistentry>
  523.         <varlistentry>
  524.           <term><sgmltag class="emptytag">digit</sgmltag></term>
  525.           <listitem><para>Insert the single-level position of the element
  526.           in its parent element.  How the digit is displayed is determined
  527.           by the corresponding digit format.</para></listitem>
  528.         </varlistentry>
  529.       </variablelist>
  530.  
  531.       <para>The Serbian label formatters for sections and figures follow.</para>
  532.  
  533.       <programlisting><![CDATA[
  534. #: ../xslt/gettext/l10n.xml.in.h:1162
  535. msgid ""
  536. "<msgid>section.number</msgid> "
  537. "<msgstr><parent/>.<digit/></msgstr>"
  538. msgstr""
  539. "<msgstr><parent/>.<digit/></msgstr>"
  540.  
  541. #: ../xslt/gettext/l10n.xml.in.h:525
  542. msgid ""
  543. "<msgid>figure.number</msgid> "
  544. "<msgstr><parent/>-<digit/></msgstr>"
  545. msgstr ""
  546. "<msgstr><parent/>-<digit/></msgstr>"
  547. ]]></programlisting>
  548.  
  549.       <para>Note that <sgmltag>msgstr</sgmltag> elements are used to contain
  550.       the strings, even though neither plural forms nor roles are being used.
  551.       This is because a <sgmltag>msgid</sgmltag> has been inserted into the
  552.       translatable string to allow number formatters for different elements
  553.       to be distinct messages in PO files.</para>
  554.     </section>
  555.  
  556.     <section id="translating-types-digits">
  557.       <title>Digit Formats</title>
  558.       <para>Digits are the part of an element's number that specify its
  559.       position in its parent element.  An element's number consists of
  560.       its parent number and its digit.  Digits can be formatted using
  561.       a number of numbering systems.</para>
  562.  
  563.       <para>Digit formats aren't actually format strings, nor are they
  564.       user-visible strings.  They're simply tokens that specify how to
  565.       format a number.  Currently, only the following five digit formats
  566.       are supported:</para>
  567.  
  568.       <variablelist>
  569.         <varlistentry>
  570.           <term><literal>1</literal></term>
  571.           <listitem><para>Format the number using Arabic numerals:
  572.           1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12.</para></listitem>
  573.         </varlistentry>
  574.         <varlistentry>
  575.           <term><literal>A</literal></term>
  576.           <listitem><para>Format the number using uppercase Latin letters:
  577.           A, B, C, D, E, F, G, H, I, J, K, L.</para></listitem>
  578.         </varlistentry>
  579.         <varlistentry>
  580.           <term><literal>a</literal></term>
  581.           <listitem><para>Format the number using lowercase Latin letters:
  582.           a, b, c, d, e, f, g, h, i, j, k, l.</para></listitem>
  583.         </varlistentry>
  584.         <varlistentry>
  585.           <term><literal>I</literal></term>
  586.           <listitem><para>Format the number using uppercase Roman numerals:
  587.           I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII:</para></listitem>
  588.         </varlistentry>
  589.         <varlistentry>
  590.           <term><literal>i</literal></term>
  591.           <listitem><para>Format the number using lowercase Roman numerals:
  592.           i, ii, iii, iv, v, vi, vii, viii, ix, x, xi, xii:</para></listitem>
  593.         </varlistentry>
  594.       </variablelist>
  595.  
  596.       <note><para>These five numbering systems are unlikely to be sufficient,
  597.       particularly for non-Western languages.  Translators who would like to
  598.       format numbers differently should contact the maintainers, and we can
  599.       try to add additional digit formats.</para></note>
  600.     </section>
  601.  
  602.     <section id="translating-types-xrefs">
  603.       <title>Cross Reference Formatters</title>
  604.       <para>Cross reference formatters are used to format the text of a link
  605.       to another element in the document.  In many languages, how best to
  606.       format an individual cross reference will depend on its usage.  Often,
  607.       cross references will need to be formatted differently based on their
  608.       grammatical role in a sentence.</para>
  609.  
  610.       <para>The cross reference formatters allow translators to provide multiple
  611.       formattings using roles.  Documentation authors and translators can then
  612.       select the format for a cross reference using the &xrefstyle; attribute on
  613.       the <sgmltag>xref</sgmltag> element.  The Gnome documentation stylesheets
  614.       allow &xrefstyle; attributes of the form
  615.       <sgmltag class="attvalue">role:<replaceable>somerole</replaceable></sgmltag>,
  616.       where <replaceable>somerole</replaceable> is the role to be passed to the
  617.       cross reference formatter.</para>
  618.  
  619.       <para>Cross reference formatters generally provide the following three
  620.       format arguments:</para>
  621.  
  622.       <variablelist>
  623.         <varlistentry>
  624.           <term><sgmltag class="emptytag">title</sgmltag></term>
  625.           <listitem><para>Insert the title of the element being referenced.
  626.           For most types of element, the title is simply provided by the
  627.           <sgmltag>title</sgmltag> in DocBook.  A few DocBook elements,
  628.           notably <sgmltag>refentry</sgmltag>, have more complicated
  629.           content models.  Translators need only reference the argument,
  630.           and the stylesheets will determine the title.</para></listitem>
  631.         </varlistentry>
  632.         <varlistentry>
  633.           <term><sgmltag class="emptytag">titleabbrev</sgmltag></term>
  634.           <listitem><para>Insert the abbreviated title of the element
  635.           being referenced.  Abbreviated titles are provided by the
  636.           <sgmltag>titleabbrev</sgmltag> element in DocBook.  If the
  637.           labeled element does not have an abbreviated title, the
  638.           title is used instead.</para></listitem>
  639.         </varlistentry>
  640.         <varlistentry>
  641.           <term><sgmltag class="emptytag">number</sgmltag></term>
  642.           <listitem><para>Insert the fully qualified number of the element
  643.           being referenced.  For most label formatters, there is a corresponding
  644.           number formatter that will be called for this argument.</para></listitem>
  645.         </varlistentry>
  646.       </variablelist>
  647.  
  648.       <remark>Insert an example here</remark>
  649.     </section>
  650.  
  651.     <section id="translating-types-tooltips">
  652.       <title>Tooltip Formatters</title>
  653.       <para>Each hyperlink in the HTML output is given a tooltip by the
  654.       stylesheets.  Since hyperlinks can be created using a number of
  655.       different semantic linking mechanisms in DocBook, the stylesheets
  656.       are able to provide rich information in the hyperlink tooltips.
  657.       The stylesheets provide tooltip formatters for various linking
  658.       mechanisms.  These can then be translated to provide rich
  659.       information about hyperlinks in any language.</para>
  660.  
  661.       <para>For example, the <sgmltag>email</sgmltag> element in DocBook is
  662.       converted into a hyperlink allowing users to send email to the given
  663.       address.  The Serbian translation for this formatter follows.</para>
  664.  
  665.       <programlisting><![CDATA[
  666. #: ../xslt/gettext/l10n.xml.in.h:329
  667. msgid ""
  668. "<msgid>email.tooltip</msgid> "
  669. "<msgstr>Send email to ‚Äò<node/>‚Äô.</msgstr>"
  670. msgstr ""
  671. "–ü–æ—à–∞—ô–∏—Ç–µ –µ-–ø–∏—Å–º–æ –Ω–∞ ‚Äû<node/>‚Äú."
  672. ]]></programlisting>
  673.  
  674.       <para>Each tooltip formatter will have its own format arguments.
  675.       Generally, only a single format argument will be needed, and the
  676.       translator comments for the string should clearly specify the
  677.       valid arguments.</para>
  678.     </section>
  679.   </section>
  680. </section>
  681.