|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
ATTENTION! This is the template for generating language.doc. If you want to
|
|
Packit Service |
50c9f2 |
change the language.doc, make the changes here and inside maintainers.txt.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
/******************************************************************************
|
|
Packit Service |
50c9f2 |
* %(editnote)s
|
|
Packit Service |
50c9f2 |
*
|
|
Packit Service |
50c9f2 |
* Copyright (C) 1997-2015 by Dimitri van Heesch.
|
|
Packit Service |
50c9f2 |
*
|
|
Packit Service |
50c9f2 |
* Permission to use, copy, modify, and distribute this software and its
|
|
Packit Service |
50c9f2 |
* documentation under the terms of the GNU General Public License is hereby
|
|
Packit Service |
50c9f2 |
* granted. No representations are made about the suitability of this software
|
|
Packit Service |
50c9f2 |
* for any purpose. It is provided "as is" without express or implied warranty.
|
|
Packit Service |
50c9f2 |
* See the GNU General Public License for more details.
|
|
Packit Service |
50c9f2 |
*
|
|
Packit Service |
50c9f2 |
* Documents produced by doxygen are derivative works derived from the
|
|
Packit Service |
50c9f2 |
* input used in their production; they are not affected by this license.
|
|
Packit Service |
50c9f2 |
*
|
|
Packit Service |
50c9f2 |
*/
|
|
Packit Service |
50c9f2 |
/*! \page langhowto Internationalization
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Support for multiple languages
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Doxygen has built-in support for multiple languages. This means that the
|
|
Packit Service |
50c9f2 |
text fragments, generated by doxygen, can be produced in languages other
|
|
Packit Service |
50c9f2 |
than English (the default). The output language is chosen through the
|
|
Packit Service |
50c9f2 |
configuration option \ref cfg_output_language "OUTPUT_LANGUAGE" in the
|
|
Packit Service |
50c9f2 |
configuration file (with default name and known as Doxyfile). To switch
|
|
Packit Service |
50c9f2 |
between languages inside a comment block the \ref cmdtilde "\\~" command
|
|
Packit Service |
50c9f2 |
can be used.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Currently (version %(doxVersion)s), %(numLangStr)s languages
|
|
Packit Service |
50c9f2 |
are supported (sorted alphabetically):
|
|
Packit Service |
50c9f2 |
%(supportedLangReadableStr)s.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The table of information related to the supported languages follows.
|
|
Packit Service |
50c9f2 |
It is sorted by language alphabetically. The Status column
|
|
Packit Service |
50c9f2 |
was generated from sources and shows approximately the last version
|
|
Packit Service |
50c9f2 |
when the translator was updated.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
%(informationTable)s
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Most people on the list have indicated that they were also busy
|
|
Packit Service |
50c9f2 |
doing other things, so if you want to help to speed things up please
|
|
Packit Service |
50c9f2 |
let them (or me) know.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
If you want to add support for a language that is not yet listed
|
|
Packit Service |
50c9f2 |
please read the next section.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Adding a new language to doxygen
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
This short HOWTO explains how to add support for the new language to doxygen:
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Just follow the following steps:
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Tell me for which language you want to add support. If no one else
|
|
Packit Service |
50c9f2 |
is already working on support for that language, you will be
|
|
Packit Service |
50c9f2 |
assigned as the maintainer for the language.
|
|
Packit Service |
50c9f2 |
Create a copy of `doxygen/src/translator_en.h` and name it
|
|
Packit Service |
50c9f2 |
`doxygen/src/translator_<your_2_letter_country_code>.h`
|
|
Packit Service |
50c9f2 |
I'll use `xx` in the rest of this document (and `XX` for the uppercase version).
|
|
Packit Service |
50c9f2 |
Edit `doxygen/src/language.cpp`:
|
|
Packit Service |
50c9f2 |
Add the following code:
|
|
Packit Service |
50c9f2 |
\verbatim
|
|
Packit Service |
50c9f2 |
#ifdef LANG_XX
|
|
Packit Service |
50c9f2 |
#include<translator_xx.h>
|
|
Packit Service |
50c9f2 |
#endif
|
|
Packit Service |
50c9f2 |
\endverbatim
|
|
Packit Service |
50c9f2 |
Remember to use the same symbol `LANG_XX` that was added to `doxygen/src/lang_cfg.h`.
|
|
Packit Service |
50c9f2 |
Now, in setTranslator() add
|
|
Packit Service |
50c9f2 |
\verbatim
|
|
Packit Service |
50c9f2 |
#ifdef LANG_XX
|
|
Packit Service |
50c9f2 |
else if (L_EQUAL("your_language_name"))
|
|
Packit Service |
50c9f2 |
{
|
|
Packit Service |
50c9f2 |
theTranslator = new TranslatorYourLanguage;
|
|
Packit Service |
50c9f2 |
}
|
|
Packit Service |
50c9f2 |
#endif
|
|
Packit Service |
50c9f2 |
\endverbatim
|
|
Packit Service |
50c9f2 |
after the if { ... } . I.e., it must be placed after the code
|
|
Packit Service |
50c9f2 |
for creating the English translator at the beginning, and before the
|
|
Packit Service |
50c9f2 |
else { ... } part that creates the translator for the
|
|
Packit Service |
50c9f2 |
default language (English again).
|
|
Packit Service |
50c9f2 |
Edit doxygen/src/translator_xx.h :
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Use the UTF-8 capable editor and open the file using the UTF-8 mode.
|
|
Packit Service |
50c9f2 |
Rename TRANSLATOR_EN_H to TRANSLATOR_XX_H
|
|
Packit Service |
50c9f2 |
twice (i.e. in the \c \#ifndef and \c \#define preprocessor commands at
|
|
Packit Service |
50c9f2 |
the beginning of the file).
|
|
Packit Service |
50c9f2 |
Rename \c TranslatorEnglish to \c TranslatorYourLanguage
|
|
Packit Service |
50c9f2 |
In the member idLanguage() change "english" into the
|
|
Packit Service |
50c9f2 |
name of your language (use lower case characters only). Depending
|
|
Packit Service |
50c9f2 |
on the language you may also wish to change the member functions
|
|
Packit Service |
50c9f2 |
`latexLanguageSupportCommand()` and other (you will recognize them when
|
|
Packit Service |
50c9f2 |
you start the work).
|
|
Packit Service |
50c9f2 |
Edit all the strings that are returned by the member functions that
|
|
Packit Service |
50c9f2 |
start with \c tr.
|
|
Packit Service |
50c9f2 |
Try to match punctuation and capitals!
|
|
Packit Service |
50c9f2 |
To enter special characters (with accents) you can:
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Enter them directly if your keyboard supports that. Recall that
|
|
Packit Service |
50c9f2 |
the text is expected to be saved using the UTF-8 encoding. Doxygen
|
|
Packit Service |
50c9f2 |
will translate the characters to proper \LaTeX and
|
|
Packit Service |
50c9f2 |
leaves the HTML and man output in UTF-8.
|
|
Packit Service |
50c9f2 |
Use HTML codes like \c \ä for an \c a with an \c umlaut (i.e. \c ä).
|
|
Packit Service |
50c9f2 |
See the HTML specification for the codes.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
On *nix systems:
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Rerun the `configure` script from the root (i.e. in the \c doxygen directory) so
|
|
Packit Service |
50c9f2 |
that it generates `doxygen/src/lang_cfg.h`.
|
|
Packit Service |
50c9f2 |
This file should now contain a \c \#define for your language code.
|
|
Packit Service |
50c9f2 |
Run \c make again from the root (i.e. in the \c doxygen
|
|
Packit Service |
50c9f2 |
directory) of the distribution, in order to regenerate the `Makefile`s.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
On Windows:
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
stop Visual Stdio
|
|
Packit Service |
50c9f2 |
open a command window
|
|
Packit Service |
50c9f2 |
goto the directory `doxygen\src`
|
|
Packit Service |
50c9f2 |
give the command `python languages.py > ..\winbuild\Languages.rules`
|
|
Packit Service |
50c9f2 |
close the command window
|
|
Packit Service |
50c9f2 |
start Visual Studio again
|
|
Packit Service |
50c9f2 |
Your language should now be selectable in the `General` part of the `Settings` of the `Properties`
|
|
Packit Service |
50c9f2 |
window of `lang_cfg.py`, by default Your language will be `on`. Rebuild `doxygen` (and `doxywizard`) now.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Now you can use OUTPUT_LANGUAGE = your_language_name
|
|
Packit Service |
50c9f2 |
in the config file to generate output in your language.
|
|
Packit Service |
50c9f2 |
Send translator_xx.h to me so I can add it to doxygen.
|
|
Packit Service |
50c9f2 |
Send also your name and e-mail address to be included in the
|
|
Packit Service |
50c9f2 |
\c maintainers.txt list. You can also clone the doxygen repository
|
|
Packit Service |
50c9f2 |
at GitHub and make a Pull Request later.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Maintaining a language
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
New versions of doxygen may use new translated sentences. In such
|
|
Packit Service |
50c9f2 |
situation, the \c Translator class requires implementation of new
|
|
Packit Service |
50c9f2 |
methods -- its interface changes. Of course, the English
|
|
Packit Service |
50c9f2 |
sentences need to be translated to the other languages. At least,
|
|
Packit Service |
50c9f2 |
new methods have to be implemented by the language-related
|
|
Packit Service |
50c9f2 |
translator class; otherwise, doxygen wouldn't even compile. Waiting
|
|
Packit Service |
50c9f2 |
until all language maintainers have translated the new sentences and
|
|
Packit Service |
50c9f2 |
sent the results would not be very practical. The following text
|
|
Packit Service |
50c9f2 |
describes the usage of translator adapters to solve the problem.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The role of Translator Adapters.
|
|
Packit Service |
50c9f2 |
Whenever the \c Translator class interface changes in the new
|
|
Packit Service |
50c9f2 |
release, the new class \c TranslatorAdapter_x_y_z is added to the \c
|
|
Packit Service |
50c9f2 |
translator_adapter.h file (here x, y, and z are numbers that
|
|
Packit Service |
50c9f2 |
correspond to the current official version of doxygen). All
|
|
Packit Service |
50c9f2 |
translators that previously derived from the \c Translator class now
|
|
Packit Service |
50c9f2 |
derive from this adapter class.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The \c TranslatorAdapter_x_y_z class implements the new, required
|
|
Packit Service |
50c9f2 |
methods. If the new method replaces some similar but obsolete
|
|
Packit Service |
50c9f2 |
method(s) (e.g. if the number of arguments changed and/or the
|
|
Packit Service |
50c9f2 |
functionality of the older method was changed or enriched), the \c
|
|
Packit Service |
50c9f2 |
TranslatorAdapter_x_y_z class may use the obsolete method to get the
|
|
Packit Service |
50c9f2 |
result which is as close as possible to the older result in the
|
|
Packit Service |
50c9f2 |
target language. If it is not possible, the result (the default
|
|
Packit Service |
50c9f2 |
translation) is obtained using the English translator, which is (by
|
|
Packit Service |
50c9f2 |
definition) always up-to-date.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
For example, when the new \c trFile() method with
|
|
Packit Service |
50c9f2 |
parameters (to determine the capitalization of the first letter and
|
|
Packit Service |
50c9f2 |
the singular/plural form) was introduced to replace the older method
|
|
Packit Service |
50c9f2 |
\c trFiles() without arguments, the following code appeared in one
|
|
Packit Service |
50c9f2 |
of the translator adapter classes:
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
\verbatim
|
|
Packit Service |
50c9f2 |
/*! This is the default implementation of the obsolete method
|
|
Packit Service |
50c9f2 |
* used in the documentation of a group before the list of
|
|
Packit Service |
50c9f2 |
* links to documented files. This is possibly localized.
|
|
Packit Service |
50c9f2 |
*/
|
|
Packit Service |
50c9f2 |
virtual QCString trFiles()
|
|
Packit Service |
50c9f2 |
{ return "Files"; }
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
/*! This is the localized implementation of newer equivalent
|
|
Packit Service |
50c9f2 |
* using the obsolete method trFiles().
|
|
Packit Service |
50c9f2 |
*/
|
|
Packit Service |
50c9f2 |
virtual QCString trFile(bool first_capital, bool singular)
|
|
Packit Service |
50c9f2 |
{
|
|
Packit Service |
50c9f2 |
if (first_capital && !singular)
|
|
Packit Service |
50c9f2 |
return trFiles(); // possibly localized, obsolete method
|
|
Packit Service |
50c9f2 |
else
|
|
Packit Service |
50c9f2 |
return english.trFile(first_capital, singular);
|
|
Packit Service |
50c9f2 |
}
|
|
Packit Service |
50c9f2 |
\endverbatim
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The \c trFiles() is not present in the \c TranslatorEnglish class,
|
|
Packit Service |
50c9f2 |
because it was removed as obsolete. However, it was used until now
|
|
Packit Service |
50c9f2 |
and its call was replaced by
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
\verbatim
|
|
Packit Service |
50c9f2 |
trFile(true, false)
|
|
Packit Service |
50c9f2 |
\endverbatim
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
in the doxygen source files. Probably, many language translators
|
|
Packit Service |
50c9f2 |
implemented the obsolete method, so it perfectly makes sense to use
|
|
Packit Service |
50c9f2 |
the same language dependent result in those cases. The \c
|
|
Packit Service |
50c9f2 |
TranslatorEnglish does not implement the old method. It derives
|
|
Packit Service |
50c9f2 |
from the abstract \c Translator class. On the other hand, the old
|
|
Packit Service |
50c9f2 |
translator for a different language does not implement the new \c
|
|
Packit Service |
50c9f2 |
trFile() method. Because of that it is derived from another base
|
|
Packit Service |
50c9f2 |
class -- \c TranslatorAdapter_x_y_z. The \c TranslatorAdapter_x_y_z
|
|
Packit Service |
50c9f2 |
class has to implement the new, required \c trFile() method.
|
|
Packit Service |
50c9f2 |
However, the translator adapter would not be compiled if the \c
|
|
Packit Service |
50c9f2 |
trFiles() method was not implemented. This is the reason for
|
|
Packit Service |
50c9f2 |
implementing the old method in the translator adapter class (using
|
|
Packit Service |
50c9f2 |
the same code, that was removed from the TranslatorEnglish).
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The simplest way would be to pass the arguments to the English
|
|
Packit Service |
50c9f2 |
translator and to return its result. Instead, the adapter uses the
|
|
Packit Service |
50c9f2 |
old \c trFiles() in one special case -- when the new
|
|
Packit Service |
50c9f2 |
trFile(true, false) is called. This is the
|
|
Packit Service |
50c9f2 |
mostly used case at the time of introducing the new method -- see
|
|
Packit Service |
50c9f2 |
above. While this may look too complicated, the technique allows
|
|
Packit Service |
50c9f2 |
the developers of the core sources to change the Translator
|
|
Packit Service |
50c9f2 |
interface, while the users may not even notice the change. Of
|
|
Packit Service |
50c9f2 |
course, when the new \c trFile() is used with different arguments,
|
|
Packit Service |
50c9f2 |
the English result is returned and it will be noticed by non English
|
|
Packit Service |
50c9f2 |
users. Here the maintainer of the language translator should
|
|
Packit Service |
50c9f2 |
implement at least that one particular method.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
What says the base class of a language translator?
|
|
Packit Service |
50c9f2 |
If the language translator class inherits from any adapter class then
|
|
Packit Service |
50c9f2 |
maintenance is needed. In such case, the language translator is
|
|
Packit Service |
50c9f2 |
considered not up-to-date. On the other hand, if the language
|
|
Packit Service |
50c9f2 |
translator derives directly from the abstract class \c Translator, the
|
|
Packit Service |
50c9f2 |
language translator is up-to-date.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The translator adapter classes are chained so that the older
|
|
Packit Service |
50c9f2 |
translator adapter class uses the one-step-newer translator adapter
|
|
Packit Service |
50c9f2 |
as the base class. The newer adapter does less \e adapting work
|
|
Packit Service |
50c9f2 |
than the older one. The oldest adapter class derives (indirectly)
|
|
Packit Service |
50c9f2 |
from all of the adapter classes. The name of the adapter class is
|
|
Packit Service |
50c9f2 |
chosen so that its suffix is derived from the previous official
|
|
Packit Service |
50c9f2 |
version of doxygen that did not need the adapter. This way, one can
|
|
Packit Service |
50c9f2 |
say approximately, when the language translator class was last
|
|
Packit Service |
50c9f2 |
updated -- see details below.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The newest translator adapter derives from the abstract \c
|
|
Packit Service |
50c9f2 |
TranslatorAdapterBase class that derives directly from the abstract
|
|
Packit Service |
50c9f2 |
\c Translator class. It adds only the private English-translator
|
|
Packit Service |
50c9f2 |
member for easy implementation of the default translation inside the
|
|
Packit Service |
50c9f2 |
adapter classes, and it also enforces implementation of one method
|
|
Packit Service |
50c9f2 |
for notifying the user that the language translation is not up-to-date
|
|
Packit Service |
50c9f2 |
(because of that some sentences in the generated files may appear in
|
|
Packit Service |
50c9f2 |
English).
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Once the oldest adapter class is not used by any of the language
|
|
Packit Service |
50c9f2 |
translators, it can be removed from the doxygen project. The
|
|
Packit Service |
50c9f2 |
maintainers should try to reach the state with the minimal number of
|
|
Packit Service |
50c9f2 |
translator adapter classes.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
To simplify the maintenance of the language translator classes
|
|
Packit Service |
50c9f2 |
for the supported languages, the \c translator.py Python
|
|
Packit Service |
50c9f2 |
script was developed (located in \c doxygen/doc directory).
|
|
Packit Service |
50c9f2 |
It extracts the important information about obsolete and
|
|
Packit Service |
50c9f2 |
new methods from the source files for each of the languages.
|
|
Packit Service |
50c9f2 |
The information is stored in the translator report ASCII file
|
|
Packit Service |
50c9f2 |
(\c %(translatorReportFileName)s).
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
\htmlonly If you compiled this documentation
|
|
Packit Service |
50c9f2 |
from sources and if you have also doxygen sources available the
|
|
Packit Service |
50c9f2 |
link %(translatorReportLink)s should be valid.\endhtmlonly
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Looking at the base class of the language translator, the script
|
|
Packit Service |
50c9f2 |
guesses also the status of the translator -- see the last column of
|
|
Packit Service |
50c9f2 |
the table with languages above. The \c translator.py is called
|
|
Packit Service |
50c9f2 |
automatically when the doxygen documentation is generated. You can
|
|
Packit Service |
50c9f2 |
also run the script manually whenever you feel that it can help you.
|
|
Packit Service |
50c9f2 |
Of course, you are not forced to use the results of the script. You
|
|
Packit Service |
50c9f2 |
can find the same information by looking at the adapter class and
|
|
Packit Service |
50c9f2 |
its base classes.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
How should I update my language translator? First, you
|
|
Packit Service |
50c9f2 |
should be the language maintainer, or you should let him/her know
|
|
Packit Service |
50c9f2 |
about the changes. The following text was written for the language
|
|
Packit Service |
50c9f2 |
maintainers as the primary audience.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
There are several approaches to be taken when updating your
|
|
Packit Service |
50c9f2 |
language. If you are not extremely busy, you should always chose
|
|
Packit Service |
50c9f2 |
the most radical one. When the update takes much more time than you
|
|
Packit Service |
50c9f2 |
expected, you can always decide use some suitable translator adapter to
|
|
Packit Service |
50c9f2 |
finish the changes later and still make your translator working.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The most radical way of updating the language translator is
|
|
Packit Service |
50c9f2 |
to make your translator class derive directly
|
|
Packit Service |
50c9f2 |
from the abstract class \c Translator and provide translations for the
|
|
Packit Service |
50c9f2 |
methods that are required to be implemented -- the compiler will
|
|
Packit Service |
50c9f2 |
tell you if you forgot to implement some of them. If you are in
|
|
Packit Service |
50c9f2 |
doubt, have a look at the \c TranslatorEnglish class to recognize the
|
|
Packit Service |
50c9f2 |
purpose of the implemented method. Looking at the previously used
|
|
Packit Service |
50c9f2 |
adapter class may help you sometimes, but it can also be misleading
|
|
Packit Service |
50c9f2 |
because the adapter classes do implement also the obsolete methods
|
|
Packit Service |
50c9f2 |
(see the previous \c trFiles() example).
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
In other words, the up-to-date language translators do not need the
|
|
Packit Service |
50c9f2 |
\c TranslatorAdapter_x_y_z classes at all, and you do not need to
|
|
Packit Service |
50c9f2 |
implement anything else than the methods required by the Translator
|
|
Packit Service |
50c9f2 |
class (i.e. the pure virtual methods of the \c Translator -- they
|
|
Packit Service |
50c9f2 |
end with =0; ).
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
If everything compiles fine, try to run \c translator.py, and have a
|
|
Packit Service |
50c9f2 |
look at the translator report (ASCII file) at the \c doxygen/doc
|
|
Packit Service |
50c9f2 |
directory. Your translator is marked as up-to-date only if the script
|
|
Packit Service |
50c9f2 |
does not detect anything special. If the translator uses the \c Translator
|
|
Packit Service |
50c9f2 |
base class, there still may be some remarks related to your source code.
|
|
Packit Service |
50c9f2 |
In the case, the translator is marked as almost up-to-date.
|
|
Packit Service |
50c9f2 |
Namely, the obsolete methods--that are not used at all--may be listed in the
|
|
Packit Service |
50c9f2 |
section for your language. Simply, remove their code (and run the \c
|
|
Packit Service |
50c9f2 |
translator.py again). Also, you will be informed when you forgot to
|
|
Packit Service |
50c9f2 |
change the base class of your translator class to some newer adapter
|
|
Packit Service |
50c9f2 |
class or directly to the Translator class.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
If you do not have time to finish all the updates you should
|
|
Packit Service |
50c9f2 |
still start with the most radical approach as described
|
|
Packit Service |
50c9f2 |
above. You can always change the base class to the translator
|
|
Packit Service |
50c9f2 |
adapter class that implements all of the not-yet-implemented methods.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
If you prefer to update your translator gradually, have a look
|
|
Packit Service |
50c9f2 |
at \c TranslatorEnglish (the \c translator_en.h file). Inside, you
|
|
Packit Service |
50c9f2 |
will find the comments like new since 1.2.4 that separate
|
|
Packit Service |
50c9f2 |
always a number of methods that were implemented in the stated
|
|
Packit Service |
50c9f2 |
version. Do implement the group of methods that are placed below the
|
|
Packit Service |
50c9f2 |
comment that uses the same version numbers as your translator adapter
|
|
Packit Service |
50c9f2 |
class. (For example, your translator class have to use the \c
|
|
Packit Service |
50c9f2 |
TranslatorAdapter_1_2_4, if it does not implement the methods below
|
|
Packit Service |
50c9f2 |
the comment new since 1.2.4 . When you implement them,
|
|
Packit Service |
50c9f2 |
your class should use a newer translator adapter.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Run the \c translator.py script occasionally and give it your \c xx
|
|
Packit Service |
50c9f2 |
identification (from \c translator_xx.h) to create the translator
|
|
Packit Service |
50c9f2 |
report shorter (also produced faster) -- it will contain only the
|
|
Packit Service |
50c9f2 |
information related to your translator. Once you reach the state when
|
|
Packit Service |
50c9f2 |
the base class should be changed to some newer adapter, you will see
|
|
Packit Service |
50c9f2 |
the note in the translator report.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Warning: Don't forget to compile doxygen to discover, whether it is
|
|
Packit Service |
50c9f2 |
compilable. The \c translator.py does not check if everything is
|
|
Packit Service |
50c9f2 |
correct with respect to the compiler. Because of that, it may lie
|
|
Packit Service |
50c9f2 |
sometimes about the necessary base class.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
The most obsolete language translators would lead to
|
|
Packit Service |
50c9f2 |
implementation of too complicated adapters. Because of that, doxygen
|
|
Packit Service |
50c9f2 |
developers may decide to derive such translators from the \c
|
|
Packit Service |
50c9f2 |
TranslatorEnglish class, which is by definition always up-to-date.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
When doing so, all the missing methods will be replaced by the
|
|
Packit Service |
50c9f2 |
English translation. This means that not-implemented methods will
|
|
Packit Service |
50c9f2 |
always return the English result. Such translators are marked using
|
|
Packit Service |
50c9f2 |
the word \c obsolete. You should read it really obsolete. No
|
|
Packit Service |
50c9f2 |
guess about the last update can be done.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
Often, it is possible to construct better result from the obsolete
|
|
Packit Service |
50c9f2 |
methods. Because of that, the translator adapter classes should be
|
|
Packit Service |
50c9f2 |
used if possible. On the other hand, implementation of adapters for
|
|
Packit Service |
50c9f2 |
really obsolete translators brings too much maintenance and
|
|
Packit Service |
50c9f2 |
run-time overhead.
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
\htmlonly
|
|
Packit Service |
50c9f2 |
Go to the next section or return to the
|
|
Packit Service |
50c9f2 |
index.
|
|
Packit Service |
50c9f2 |
\endhtmlonly
|
|
Packit Service |
50c9f2 |
|
|
Packit Service |
50c9f2 |
*/
|
|
Packit Service |
50c9f2 |
|