52a5fc26d52fa8d8ab18ed6f96d009083bbb5c84
[demo.git] / VES5.0 / doxygen-1.8.12 / html / langhowto.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.12"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>Doxygen: Internationalization</title>
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <link href="navtree.css" rel="stylesheet" type="text/css"/>
13 <script type="text/javascript" src="resize.js"></script>
14 <script type="text/javascript" src="navtreedata.js"></script>
15 <script type="text/javascript" src="navtree.js"></script>
16 <script type="text/javascript">
17   $(document).ready(initResizable);
18 </script>
19 <link href="doxygen_manual.css" rel="stylesheet" type="text/css" />
20 </head>
21 <body>
22 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
23 <div id="titlearea">
24 <table cellspacing="0" cellpadding="0">
25  <tbody>
26  <tr style="height: 56px;">
27   <td id="projectalign" style="padding-left: 0.5em;">
28    <div id="projectname">Doxygen
29    </div>
30   </td>
31  </tr>
32  </tbody>
33 </table>
34 </div>
35 <!-- end header part -->
36 <!-- Generated by Doxygen 1.8.12 -->
37 </div><!-- top -->
38 <div id="side-nav" class="ui-resizable side-nav-resizable">
39   <div id="nav-tree">
40     <div id="nav-tree-contents">
41       <div id="nav-sync" class="sync"></div>
42     </div>
43   </div>
44   <div id="splitbar" style="-moz-user-select:none;" 
45        class="ui-resizable-handle">
46   </div>
47 </div>
48 <script type="text/javascript">
49 $(document).ready(function(){initNavTree('langhowto.html','');});
50 </script>
51 <div id="doc-content">
52 <div class="header">
53   <div class="headertitle">
54 <div class="title">Internationalization </div>  </div>
55 </div><!--header-->
56 <div class="contents">
57 <div class="textblock"><h3>Support for multiple languages</h3>
58 <p>Doxygen has built-in support for multiple languages. This means that the text fragments, generated by doxygen, can be produced in languages other than English (the default). The output language is chosen through the configuration option <a class="el" href="config.html#cfg_output_language">OUTPUT_LANGUAGE</a> in the configuration file (with default name and known as Doxyfile).</p>
59 <p>Currently (version 1.8.12), 40 languages are supported (sorted alphabetically): Afrikaans, Arabic, Armenian, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Finnish, French, German, Greek, Hungarian, Indonesian, Italian, Japanese (+En), Korean (+En), Latvian, Lithuanian, Macedonian, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, SerbianCyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, Ukrainian, and Vietnamese..</p>
60 <p>The table of information related to the supported languages follows. It is sorted by language alphabetically. The <b>Status</b> column was generated from sources and shows approximately the last version when the translator was updated.</p>
61 <p> 
62             </p>
63             <table align="center" cellspacing="0" cellpadding="0" border="0">
64             <tr bgcolor="#000000">
65             <td>
66               <table cellspacing="1" cellpadding="2" border="0">
67               <tr bgcolor="#4040c0">
68               <td ><b><font size="+1" color="#ffffff"> Language </font></b></td>
69               <td ><b><font size="+1" color="#ffffff"> Maintainer </font></b></td>
70               <td ><b><font size="+1" color="#ffffff"> Contact address </font>
71                       <font size="-2" color="#ffffff">(replace the at and dot)</font></b></td>
72               <td ><b><font size="+1" color="#ffffff"> Status </font></b></td>
73               </tr>
74               <!-- table content begin -->
75             
76   <tr bgcolor="#ffffff">
77     <td bgcolor="#ffffff">Afrikaans</td>
78     <td>Johan Prinsloo</td>
79     <td>johan at zippysnoek dot com</td>
80     <td bgcolor="#ffcccc">1.6.0</td>
81   </tr>
82   <tr bgcolor="#ffffff">
83     <td bgcolor="#ff5555">Arabic</td>
84     <td>Moaz Reyad<br/>Muhammad Bashir Al-Noimi</td>
85     <td><span style="color: brown">[resigned]</span><br/>mbnoimi at gmail dot com</td>
86     <td bgcolor="#ff5555">1.4.6</td>
87   </tr>
88   <tr bgcolor="#ffffff">
89     <td bgcolor="#ffffff">Armenian</td>
90     <td>Armen Tangamyan</td>
91     <td>armen dot tangamyan at anu dot edu dot au</td>
92     <td bgcolor="#ffffcc">1.8.0</td>
93   </tr>
94   <tr bgcolor="#ffffff">
95     <td bgcolor="#ffffff">Brazilian Portuguese</td>
96     <td>Fabio "FJTC" Jun Takada Chino</td>
97     <td>jun-chino at uol dot com dot br</td>
98     <td bgcolor="#ccffcc">up-to-date</td>
99   </tr>
100   <tr bgcolor="#ffffff">
101     <td bgcolor="#ffffff">Catalan</td>
102     <td>Maximiliano Pin<br/>Albert Mora</td>
103     <td>max dot pin at bitroit dot com<br/><span style="color: brown">[unreachable]</span></td>
104     <td bgcolor="#ffffcc">1.8.0</td>
105   </tr>
106   <tr bgcolor="#ffffff">
107     <td bgcolor="#ffffff">Chinese</td>
108     <td>Lian Yang<br/>Li Daobing<br/>Wei Liu</td>
109     <td>lian dot yang dot cn at gmail dot com<br/>lidaobing at gmail dot com<br/>liuwei at asiainfo dot com</td>
110     <td bgcolor="#ccffcc">up-to-date</td>
111   </tr>
112   <tr bgcolor="#ffffff">
113     <td bgcolor="#ffffff">Chinese Traditional</td>
114     <td>Daniel YC Lin<br/>Gary Lee</td>
115     <td>dlin dot tw at gmail dot com<br/>garywlee at gmail dot com</td>
116     <td bgcolor="#ccffcc">up-to-date</td>
117   </tr>
118   <tr bgcolor="#ffffff">
119     <td bgcolor="#ffffff">Croatian</td>
120     <td>Boris Bralo</td>
121     <td>boris dot bralo at gmail dot com</td>
122     <td bgcolor="#ffffcc">1.8.2</td>
123   </tr>
124   <tr bgcolor="#ffffff">
125     <td bgcolor="#ffffff">Czech</td>
126     <td>Petr Přikryl</td>
127     <td>prikryl at atlas dot cz</td>
128     <td bgcolor="#ccffcc">up-to-date</td>
129   </tr>
130   <tr bgcolor="#ffffff">
131     <td bgcolor="#ffffff">Danish</td>
132     <td>Poul-Erik Hansen<br/>Erik Søe Sørensen</td>
133     <td>pouhan at gnotometrics dot dk<br/>eriksoe+doxygen at daimi dot au dot dk</td>
134     <td bgcolor="#ffffcc">1.8.0</td>
135   </tr>
136   <tr bgcolor="#ffffff">
137     <td bgcolor="#ffffff">Dutch</td>
138     <td>Dimitri van Heesch</td>
139     <td>dimitri at stack dot nl</td>
140     <td bgcolor="#ccffcc">up-to-date</td>
141   </tr>
142   <tr bgcolor="#ffffff">
143     <td bgcolor="#ffffff">English</td>
144     <td>Dimitri van Heesch</td>
145     <td>dimitri at stack dot nl</td>
146     <td bgcolor="#ccffcc">up-to-date</td>
147   </tr>
148   <tr bgcolor="#ffffff">
149     <td bgcolor="#ffffff">Esperanto</td>
150     <td>Ander Martínez</td>
151     <td>ander dot basaundi at gmail dot com</td>
152     <td bgcolor="#ffffcc">1.8.4</td>
153   </tr>
154   <tr bgcolor="#ffffff">
155     <td bgcolor="#ffffff">Finnish</td>
156     <td>Antti Laine</td>
157     <td>antti dot a dot laine at tut dot fi</td>
158     <td bgcolor="#ffcccc">1.6.0</td>
159   </tr>
160   <tr bgcolor="#ffffff">
161     <td bgcolor="#ffffff">French</td>
162     <td>David Martinet<br/>Xavier Outhier<br/>Benoît BROSSE</td>
163     <td>contact at e-concept-applications dot fr<br/>xouthier at yahoo dot fr<br/>Benoit dot BROSSE at ingenico dot com</td>
164     <td bgcolor="#ccffcc">up-to-date</td>
165   </tr>
166   <tr bgcolor="#ffffff">
167     <td bgcolor="#ffffff">German</td>
168     <td>Peter Grotrian<br/>Jens Seidel</td>
169     <td>Peter dot Grotrian at pdv-FS dot de<br/>jensseidel at users dot sf dot net</td>
170     <td bgcolor="#ffffff">almost up-to-date</td>
171   </tr>
172   <tr bgcolor="#ffffff">
173     <td bgcolor="#ffffff">Greek</td>
174     <td>Paul Gessos</td>
175     <td>gessos dot paul at yahoo dot gr</td>
176     <td bgcolor="#ccffcc">up-to-date</td>
177   </tr>
178   <tr bgcolor="#ffffff">
179     <td bgcolor="#ff5555">Hungarian</td>
180     <td>Ákos Kiss<br/>Földvári György</td>
181     <td>akiss at users dot sourceforge dot net<br/><span style="color: brown">[unreachable]</span></td>
182     <td bgcolor="#ff5555">1.4.6</td>
183   </tr>
184   <tr bgcolor="#ffffff">
185     <td bgcolor="#ffffff">Indonesian</td>
186     <td>Hendy Irawan</td>
187     <td>ceefour at gauldong dot net</td>
188     <td bgcolor="#ffffcc">1.8.0</td>
189   </tr>
190   <tr bgcolor="#ffffff">
191     <td bgcolor="#ffffff">Italian</td>
192     <td>Alessandro Falappa<br/>Ahmed Aldo Faisal</td>
193     <td>alex dot falappa at gmail dot com<br/>aaf23 at cam dot ac dot uk</td>
194     <td bgcolor="#ccffcc">up-to-date</td>
195   </tr>
196   <tr bgcolor="#ffffff">
197     <td bgcolor="#ffffff">Japanese</td>
198     <td>Suzumizaki-Kimikata<br/>Hiroki Iseri<br/>Ryunosuke Satoh<br/>Kenji Nagamatsu<br/>Iwasa Kazmi</td>
199     <td>szmml at h12u.com<br/>goyoki at gmail dot com<br/>sun594 at hotmail dot com<br/><span style="color: brown">[unreachable]</span><br/><span style="color: brown">[unreachable]</span></td>
200     <td bgcolor="#ccffcc">up-to-date</td>
201   </tr>
202   <tr bgcolor="#ffffff">
203     <td bgcolor="#ffffff">JapaneseEn</td>
204     <td>see the Japanese language</td>
205     <td>&nbsp;</td>
206     <td bgcolor="#ccffcc">English based</td>
207   </tr>
208   <tr bgcolor="#ffffff">
209     <td bgcolor="#ffffff">Korean</td>
210     <td>Kim Taedong<br/>SooYoung Jung<br/>Richard Kim</td>
211     <td>fly1004 at gmail dot com<br/>jung5000 at gmail dot com<br/><span style="color: brown">[unreachable]</span></td>
212     <td bgcolor="#ccffcc">up-to-date</td>
213   </tr>
214   <tr bgcolor="#ffffff">
215     <td bgcolor="#ffffff">KoreanEn</td>
216     <td>see the Korean language</td>
217     <td>&nbsp;</td>
218     <td bgcolor="#ccffcc">English based</td>
219   </tr>
220   <tr bgcolor="#ffffff">
221     <td bgcolor="#ffffff">Latvian</td>
222     <td>Lauris</td>
223     <td>lauris at nix.lv</td>
224     <td bgcolor="#ffffcc">1.8.4</td>
225   </tr>
226   <tr bgcolor="#ffffff">
227     <td bgcolor="#ff5555">Lithuanian</td>
228     <td>Tomas Simonaitis<br/>Mindaugas Radzius<br/>Aidas Berukstis<br/><span style="color: red; background-color: yellow">-- searching for the maintainer --</span></td>
229     <td><span style="color: brown">[unreachable]</span><br/><span style="color: brown">[unreachable]</span><br/><span style="color: brown">[unreachable]</span><br/><span style="color: brown">[Please, try to help to find someone.]</span></td>
230     <td bgcolor="#ff5555">1.4.6</td>
231   </tr>
232   <tr bgcolor="#ffffff">
233     <td bgcolor="#ffffff">Macedonian</td>
234     <td>Slave Jovanovski</td>
235     <td>slavejovanovski at yahoo dot com</td>
236     <td bgcolor="#ffcccc">1.6.0</td>
237   </tr>
238   <tr bgcolor="#ffffff">
239     <td bgcolor="#ff5555">Norwegian</td>
240     <td>Lars Erik Jordet</td>
241     <td>lejordet at gmail dot com</td>
242     <td bgcolor="#ff5555">1.4.6</td>
243   </tr>
244   <tr bgcolor="#ffffff">
245     <td bgcolor="#ffffff">Persian</td>
246     <td>Ali Nadalizadeh</td>
247     <td>nadalizadeh at gmail dot com</td>
248     <td bgcolor="#ffcccc">1.7.5</td>
249   </tr>
250   <tr bgcolor="#ffffff">
251     <td bgcolor="#ffffff">Polish</td>
252     <td>Piotr Kaminski<br/>Grzegorz Kowal<br/>Krzysztof Kral</td>
253     <td><span style="color: brown">[unreachable]</span><br/><span style="color: brown">[unreachable]</span><br/>krzysztof dot kral at gmail dot com</td>
254     <td bgcolor="#ffffcc">1.8.2</td>
255   </tr>
256   <tr bgcolor="#ffffff">
257     <td bgcolor="#ffffff">Portuguese</td>
258     <td>Rui Godinho Lopes<br/>Fabio "FJTC" Jun Takada Chino</td>
259     <td><span style="color: brown">[resigned]</span><br/>jun-chino at uol dot com dot br</td>
260     <td bgcolor="#ccffcc">up-to-date</td>
261   </tr>
262   <tr bgcolor="#ffffff">
263     <td bgcolor="#ffffff">Romanian</td>
264     <td>Ionut Dumitrascu<br/>Alexandru Iosup</td>
265     <td>reddumy at yahoo dot com<br/>aiosup at yahoo dot com</td>
266     <td bgcolor="#ffffff">almost up-to-date</td>
267   </tr>
268   <tr bgcolor="#ffffff">
269     <td bgcolor="#ffffff">Russian</td>
270     <td>Brilliantov Kirill Vladimirovich<br/>Alexandr Chelpanov</td>
271     <td>brilliantov at byterg dot ru<br/>cav at cryptopro dot ru</td>
272     <td bgcolor="#ffffff">almost up-to-date</td>
273   </tr>
274   <tr bgcolor="#ffffff">
275     <td bgcolor="#ffffff">Serbian</td>
276     <td>Dejan Milosavljevic</td>
277     <td><span style="color: brown">[unreachable]</span></td>
278     <td bgcolor="#ffcccc">1.6.0</td>
279   </tr>
280   <tr bgcolor="#ffffff">
281     <td bgcolor="#ffffff">SerbianCyrillic</td>
282     <td>Nedeljko Stefanovic</td>
283     <td>stenedjo at yahoo dot com</td>
284     <td bgcolor="#ffcccc">1.6.0</td>
285   </tr>
286   <tr bgcolor="#ffffff">
287     <td bgcolor="#ffffff">Slovak</td>
288     <td>Kali+Laco Švec<br/>Petr Přikryl</td>
289     <td><span style="color: brown">[the Slovak language advisors]</span><br/>prikryl at atlas dot cz</td>
290     <td bgcolor="#ccffcc">up-to-date</td>
291   </tr>
292   <tr bgcolor="#ffffff">
293     <td bgcolor="#ff5555">Slovene</td>
294     <td>Matjaž Ostroveršnik</td>
295     <td>matjaz dot ostroversnik at ostri dot org</td>
296     <td bgcolor="#ff5555">1.4.6</td>
297   </tr>
298   <tr bgcolor="#ffffff">
299     <td bgcolor="#ffffff">Spanish</td>
300     <td>Bartomeu<br/>Francisco Oltra Thennet<br/>David Vaquero</td>
301     <td>bartomeu at loteria3cornella dot com<br/><span style="color: brown">[unreachable]</span><br/>david at grupoikusnet dot com</td>
302     <td bgcolor="#ccffcc">up-to-date</td>
303   </tr>
304   <tr bgcolor="#ffffff">
305     <td bgcolor="#ffffff">Swedish</td>
306     <td>Björn Palmqvist</td>
307     <td>bjorn.palmqvist at aidium.se</td>
308     <td bgcolor="#ccffcc">up-to-date</td>
309   </tr>
310   <tr bgcolor="#ffffff">
311     <td bgcolor="#ffffff">Turkish</td>
312     <td>Emin Ilker Cetinbas</td>
313     <td>niw3 at yahoo dot com</td>
314     <td bgcolor="#ffcccc">1.7.5</td>
315   </tr>
316   <tr bgcolor="#ffffff">
317     <td bgcolor="#ffffff">Ukrainian</td>
318     <td>Olexij Tkatchenko<br/>Petro  Yermolenko</td>
319     <td><span style="color: brown">[resigned]</span><br/>python at i dot ua</td>
320     <td bgcolor="#ffffcc">1.8.4</td>
321   </tr>
322   <tr bgcolor="#ffffff">
323     <td bgcolor="#ffffff">Vietnamese</td>
324     <td>Dang Minh Tuan</td>
325     <td>tuanvietkey at gmail dot com</td>
326     <td bgcolor="#ffcccc">1.6.0</td>
327   </tr>
328               <!-- table content end -->
329               </table>
330             </td>
331             </tr>
332             </table>
333             <p>
334             </p>
335 <p>Most people on the list have indicated that they were also busy doing other things, so if you want to help to speed things up please let them (or me) know.</p>
336 <p>If you want to add support for a language that is not yet listed please read the next section.</p>
337 <h3>Adding a new language to doxygen</h3>
338 <p>This short HOWTO explains how to add support for the new language to doxygen:</p>
339 <p>Just follow the following steps: </p><ol>
340 <li>
341 Tell me for which language you want to add support. If no one else is already working on support for that language, you will be assigned as the maintainer for the language. </li>
342 <li>
343 Create a copy of <code>doxygen/src/translator_en.h</code> and name it <code>doxygen/src/translator_&lt;your_2_letter_country_code&gt;.h</code> I'll use <code>xx</code> in the rest of this document (and <code>XX</code> for the uppercase version). </li>
344 <li>
345 <p class="startli">Edit <code>doxygen/src/language.cpp</code>: Add the following code: </p><pre class="fragment">#ifdef LANG_XX
346 #include&lt;translator_xx.h&gt;
347 #endif
348 </pre><p> Remember to use the same symbol <code>LANG_XX</code> that was added to <code>doxygen/src/lang_cfg.h</code>. </p>
349 <p class="endli">Now, in <code>setTranslator()</code> add </p><pre class="fragment">#ifdef LANG_XX
350     else if (L_EQUAL("your_language_name"))
351     {
352       theTranslator = new TranslatorYourLanguage;
353     }
354 #endif
355 </pre><p> after the <code>if { ... }</code>. I.e., it must be placed after the code for creating the English translator at the beginning, and before the <code>else { ... }</code> part that creates the translator for the default language (English again). </p>
356 </li>
357 <li>
358 Edit <code>doxygen/src/translator_xx.h</code>: <ul>
359 <li>
360 Use the UTF-8 capable editor and open the file using the UTF-8 mode. </li>
361 <li>
362 Rename <code>TRANSLATOR_EN_H</code> to <code>TRANSLATOR_XX_H</code> twice (i.e. in the <code>#ifndef</code> and <code>#define</code> preprocessor commands at the beginning of the file). </li>
363 <li>
364 Rename <code>TranslatorEnglish</code> to <code>TranslatorYourLanguage</code> </li>
365 <li>
366 In the member <code>idLanguage()</code> change "english" into the name of your language (use lower case characters only). Depending on the language you may also wish to change the member functions <code>latexLanguageSupportCommand()</code> and other (you will recognize them when you start the work). </li>
367 <li>
368 Edit all the strings that are returned by the member functions that start with <code>tr</code>. Try to match punctuation and capitals! To enter special characters (with accents) you can: <ul>
369 <li>
370 Enter them directly if your keyboard supports that. Recall that the text is expected to be saved using the UTF-8 encoding. Doxygen will translate the characters to proper <img class="formulaInl" alt="$\mbox{\LaTeX}$" src="form_0.png"/> and leaves the HTML and man output in UTF-8. </li>
371 <li>
372 Use HTML codes like <code>&amp;auml</code>; for an <code>a</code> with an <code>umlaut</code> (i.e. <code>&auml;</code>). See the HTML specification for the codes. </li>
373 </ul>
374 </li>
375 </ul>
376 </li>
377 <li>
378 <ul>
379 <li>
380 On *nix systems:<br />
381  <ul>
382 <li>
383 Rerun the <code>configure</code> script from the root (i.e. in the <code>doxygen</code> directory) so that it generates <code>doxygen/src/lang_cfg.h</code>. This file should now contain a <code>#define</code> for your language code.<br />
384  </li>
385 <li>
386 Run <code>make</code> again from the root (i.e. in the <code>doxygen</code> directory) of the distribution, in order to regenerate the <code>Makefile</code>s. </li>
387 </ul>
388 </li>
389 <li>
390 On Windows:<br />
391  <ul>
392 <li>
393 stop Visual Stdio<br />
394  </li>
395 <li>
396 open a command window<br />
397  </li>
398 <li>
399 goto the directory <code>doxygen\src</code><br />
400  </li>
401 <li>
402 give the command <code>python languages.py &gt; ..\winbuild\Languages.rules</code><br />
403  </li>
404 <li>
405 close the command window<br />
406  </li>
407 <li>
408 start Visual Studio again<br />
409  </li>
410 <li>
411 Your language should now be selectable in the <code>General</code> part of the <code>Settings</code> of the <code>Properties</code> window of <code>lang_cfg.py</code>, by default Your language will be <code>on</code>. Rebuild <code>doxygen</code> (and <code>doxywizard</code>) now. </li>
412 </ul>
413 </li>
414 </ul>
415 </li>
416 <li>
417 Now you can use <code>OUTPUT_LANGUAGE = your_language_name</code> in the config file to generate output in your language. </li>
418 <li>
419 Send <code>translator_xx.h</code> to me so I can add it to doxygen. Send also your name and e-mail address to be included in the <code>maintainers.txt</code> list. You can also clone the doxygen repository at GitHub and make a Pull Request later. </li>
420 </ol>
421 <h3>Maintaining a language</h3>
422 <p>New versions of doxygen may use new translated sentences. In such situation, the <code>Translator</code> class requires implementation of new methods &ndash; its interface changes. Of course, the English sentences need to be translated to the other languages. At least, new methods have to be implemented by the language-related translator class; otherwise, doxygen wouldn't even compile. Waiting until all language maintainers have translated the new sentences and sent the results would not be very practical. The following text describes the usage of translator adapters to solve the problem.</p>
423 <p><b>The role of Translator Adapters.</b> Whenever the <code>Translator</code> class interface changes in the new release, the new class <code>TranslatorAdapter_x_y_z</code> is added to the <code>translator_adapter.h</code> file (here x, y, and z are numbers that correspond to the current official version of doxygen). All translators that previously derived from the <code>Translator</code> class now derive from this adapter class.</p>
424 <p>The <code>TranslatorAdapter_x_y_z</code> class implements the new, required methods. If the new method replaces some similar but obsolete method(s) (e.g. if the number of arguments changed and/or the functionality of the older method was changed or enriched), the <code>TranslatorAdapter_x_y_z</code> class may use the obsolete method to get the result which is as close as possible to the older result in the target language. If it is not possible, the result (the default translation) is obtained using the English translator, which is (by definition) always up-to-date.</p>
425 <p><b>For example,</b> when the new <code>trFile()</code> method with parameters (to determine the capitalization of the first letter and the singular/plural form) was introduced to replace the older method <code>trFiles()</code> without arguments, the following code appeared in one of the translator adapter classes:</p>
426 <pre class="fragment">    /*! This is the default implementation of the obsolete method
427      * used in the documentation of a group before the list of
428      * links to documented files.  This is possibly localized.
429      */
430     virtual QCString trFiles()
431     { return "Files"; }
432
433     /*! This is the localized implementation of newer equivalent
434      * using the obsolete method trFiles().
435      */
436     virtual QCString trFile(bool first_capital, bool singular)
437     {
438       if (first_capital &amp;&amp; !singular)
439         return trFiles();  // possibly localized, obsolete method
440       else
441         return english.trFile(first_capital, singular);
442     }
443 </pre><p>The <code>trFiles()</code> is not present in the <code>TranslatorEnglish</code> class, because it was removed as obsolete. However, it was used until now and its call was replaced by</p>
444 <pre class="fragment">    trFile(true, false)
445 </pre><p>in the doxygen source files. Probably, many language translators implemented the obsolete method, so it perfectly makes sense to use the same language dependent result in those cases. The <code>TranslatorEnglish</code> does not implement the old method. It derives from the abstract <code>Translator</code> class. On the other hand, the old translator for a different language does not implement the new <code>trFile()</code> method. Because of that it is derived from another base class &ndash; <code>TranslatorAdapter_x_y_z</code>. The <code>TranslatorAdapter_x_y_z</code> class has to implement the new, required <code>trFile()</code> method. However, the translator adapter would not be compiled if the <code>trFiles()</code> method was not implemented. This is the reason for implementing the old method in the translator adapter class (using the same code, that was removed from the TranslatorEnglish).</p>
446 <p>The simplest way would be to pass the arguments to the English translator and to return its result. Instead, the adapter uses the old <code>trFiles()</code> in one special case &ndash; when the new <code>trFile(true,&#160;false)</code> is called. This is the mostly used case at the time of introducing the new method &ndash; see above. While this may look too complicated, the technique allows the developers of the core sources to change the Translator interface, while the users may not even notice the change. Of course, when the new <code>trFile()</code> is used with different arguments, the English result is returned and it will be noticed by non English users. Here the maintainer of the language translator should implement at least that one particular method.</p>
447 <p><b>What says the base class of a language translator?</b> If the language translator class inherits from any adapter class then maintenance is needed. In such case, the language translator is considered not up-to-date. On the other hand, if the language translator derives directly from the abstract class <code>Translator</code>, the language translator is up-to-date.</p>
448 <p>The translator adapter classes are chained so that the older translator adapter class uses the one-step-newer translator adapter as the base class. The newer adapter does less <em>adapting</em> work than the older one. The oldest adapter class derives (indirectly) from all of the adapter classes. The name of the adapter class is chosen so that its suffix is derived from the previous official version of doxygen that did not need the adapter. This way, one can say approximately, when the language translator class was last updated &ndash; see details below.</p>
449 <p>The newest translator adapter derives from the abstract <code>TranslatorAdapterBase</code> class that derives directly from the abstract <code>Translator</code> class. It adds only the private English-translator member for easy implementation of the default translation inside the adapter classes, and it also enforces implementation of one method for notifying the user that the language translation is not up-to-date (because of that some sentences in the generated files may appear in English).</p>
450 <p>Once the oldest adapter class is not used by any of the language translators, it can be removed from the doxygen project. The maintainers should try to reach the state with the minimal number of translator adapter classes.</p>
451 <p><b>To simplify the maintenance of the language translator classes</b> for the supported languages, the <code>translator.py</code> Python script was developed (located in <code>doxygen/doc</code> directory). It extracts the important information about obsolete and new methods from the source files for each of the languages. The information is stored in the translator report ASCII file (<code>translator_report.txt</code>).</p>
452 <p> If you compiled this documentation
453 from sources and if you have also doxygen sources available the
454 link <a href="../doc/translator_report.txt"
455 ><code>doxygen/doc/translator_report.txt</code></a> should be valid.</p>
456 <p>Looking at the base class of the language translator, the script guesses also the status of the translator &ndash; see the last column of the table with languages above. The <code>translator.py</code> is called automatically when the doxygen documentation is generated. You can also run the script manually whenever you feel that it can help you. Of course, you are not forced to use the results of the script. You can find the same information by looking at the adapter class and its base classes.</p>
457 <p><b>How should I update my language translator?</b> First, you should be the language maintainer, or you should let him/her know about the changes. The following text was written for the language maintainers as the primary audience.</p>
458 <p>There are several approaches to be taken when updating your language. If you are not extremely busy, you should always chose the most radical one. When the update takes much more time than you expected, you can always decide use some suitable translator adapter to finish the changes later and still make your translator working.</p>
459 <p><b>The most radical way of updating the language translator</b> is to make your translator class derive directly from the abstract class <code>Translator</code> and provide translations for the methods that are required to be implemented &ndash; the compiler will tell you if you forgot to implement some of them. If you are in doubt, have a look at the <code>TranslatorEnglish</code> class to recognize the purpose of the implemented method. Looking at the previously used adapter class may help you sometimes, but it can also be misleading because the adapter classes do implement also the obsolete methods (see the previous <code>trFiles()</code> example).</p>
460 <p>In other words, the up-to-date language translators do not need the <code>TranslatorAdapter_x_y_z</code> classes at all, and you do not need to implement anything else than the methods required by the Translator class (i.e. the pure virtual methods of the <code>Translator</code> &ndash; they end with <code>=0;</code>).</p>
461 <p>If everything compiles fine, try to run <code>translator.py</code>, and have a look at the translator report (ASCII file) at the <code>doxygen/doc</code> directory. Your translator is marked as up-to-date only if the script does not detect anything special. If the translator uses the <code>Translator</code> base class, there still may be some remarks related to your source code. In the case, the translator is marked as <em>almost up-to-date</em>. Namely, the obsolete methods&ndash;that are not used at all&ndash;may be listed in the section for your language. Simply, remove their code (and run the <code>translator.py</code> again). Also, you will be informed when you forgot to change the base class of your translator class to some newer adapter class or directly to the Translator class.</p>
462 <p><b>If you do not have time to finish all the updates</b> you should still start with <em>the most radical approach</em> as described above. You can always change the base class to the translator adapter class that implements all of the not-yet-implemented methods.</p>
463 <p><b>If you prefer to update your translator gradually</b>, have a look at <code>TranslatorEnglish</code> (the <code>translator_en.h</code> file). Inside, you will find the comments like <code>new since 1.2.4</code> that separate always a number of methods that were implemented in the stated version. Do implement the group of methods that are placed below the comment that uses the same version numbers as your translator adapter class. (For example, your translator class have to use the <code>TranslatorAdapter_1_2_4</code>, if it does not implement the methods below the comment <code>new since 1.2.4</code>. When you implement them, your class should use a newer translator adapter.</p>
464 <p>Run the <code>translator.py</code> script occasionally and give it your <code>xx</code> identification (from <code>translator_xx.h</code>) to create the translator report shorter (also produced faster) &ndash; it will contain only the information related to your translator. Once you reach the state when the base class should be changed to some newer adapter, you will see the note in the translator report.</p>
465 <p>Warning: Don't forget to compile doxygen to discover, whether it is compilable. The <code>translator.py</code> does not check if everything is correct with respect to the compiler. Because of that, it may lie sometimes about the necessary base class.</p>
466 <p><b>The most obsolete language translators</b> would lead to implementation of too complicated adapters. Because of that, doxygen developers may decide to derive such translators from the <code>TranslatorEnglish</code> class, which is by definition always up-to-date.</p>
467 <p>When doing so, all the missing methods will be replaced by the English translation. This means that not-implemented methods will always return the English result. Such translators are marked using the word <code>obsolete</code>. You should read it <b>really obsolete</b>. No guess about the last update can be done.</p>
468 <p>Often, it is possible to construct better result from the obsolete methods. Because of that, the translator adapter classes should be used if possible. On the other hand, implementation of adapters for really obsolete translators brings too much maintenance and run-time overhead.</p>
469 <p> 
470 Go to the <a href="perlmod.html">next</a> section or return to the
471  <a href="index.html">index</a>.
472  </p>
473 </div></div><!-- contents -->
474 </div><!-- doc-content -->
475 <!-- start footer part -->
476 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
477   <ul>
478     <li class="footer">Generated by
479     <a href="http://www.doxygen.org/index.html">
480     <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
481   </ul>
482 </div>
483 </body>
484 </html>