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