Difference between revisions of "Po generation tool"

(Updated since i18n APIs have been changed. Added more info.)
Line 2: Line 2:
 
[[Category:Internationalization]]
 
[[Category:Internationalization]]
 
== Overview ==
 
== Overview ==
The Po Generation Tool is an auxiliary tool of [[Internationalization|i18n library]] used extracting manifest strings from compilable Eiffel classes. Only those manifest strings which are parsed as arguments into features of `translate' and `translate_plural' are extracted. The output is an [http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html#SEC9 .po file] with void translations. The tool is being used for internationalization of EiffelStudio. The output file is the initial [https://origo.ethz.ch/eiffelsoftware/es/trunk/Delivery/studio/lang/po_files/estudio.pot estudio.pot] which is completed by appending other useful entries. See [[EiffelStudio_Internationalization|EiffelStudio Internationalization]]
+
The Po Generation Tool is an auxiliary tool of [[Internationalization|i18n library]] used extracting manifest strings from compilable Eiffel classes.  
 +
The following manifest strings are extracted:
 +
* Direct arguments of calls of `translation' and `plural_translation' are extracted.
 +
* All under feature clauses named `Internationalization'.
 +
 
 +
The output is an [http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html#SEC9 .po file] with void translations. The tool is being used for internationalization of EiffelStudio. The output file is the initial [https://origo.ethz.ch/eiffelsoftware/es/trunk/Delivery/studio/lang/po_files/estudio.pot estudio.pot] which is completed by appending other useful entries later. See [[EiffelStudio_Internationalization|EiffelStudio Internationalization]].
 +
<br>
 +
<br>
 +
The source code of the tool can be accessed [https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/tools/po_generation_tool here].
  
 
== Usage ==
 
== Usage ==
Line 19: Line 27:
  
 
== Limitations ==
 
== Limitations ==
* The tool now is not smart enough to identify a call of `translate' or `translate_plural' is from an indentifier of type I18N_LOCALE. This means that any call of the same name with `translate' and that takes one manifest string argument or of the same name with `translate_plural' and that takes two manifest string arguments is extracted.
+
* The tool now is not smart enough to identify a call of `translation' or `plural_translation' that is from an identifier of type I18N_LOCALE or others. This means that any call with the same name as `translation' and that takes one manifest string argument or with the same name as `plural_translation' and that takes two manifest string arguments is extracted.
* Suggestion: Do not use a feature with signature like "translate (a_string: STRING_GENERAL)" or "translate_plural (a_string1: STRING_GENERAL; a_string2: STRING_GENERAL)", if i18n library is used.
+
* Suggestion: Do not use a feature with signature like "translation(a_string: STRING_GENERAL)" or "plural_translation (a_string1: STRING_GENERAL; a_string2: STRING_GENERAL)" in your system, if i18n library and the tool are used.

Revision as of 20:10, 23 December 2008

Overview

The Po Generation Tool is an auxiliary tool of i18n library used extracting manifest strings from compilable Eiffel classes. The following manifest strings are extracted:

  • Direct arguments of calls of `translation' and `plural_translation' are extracted.
  • All under feature clauses named `Internationalization'.

The output is an .po file with void translations. The tool is being used for internationalization of EiffelStudio. The output file is the initial estudio.pot which is completed by appending other useful entries later. See EiffelStudio Internationalization.

The source code of the tool can be accessed here.

Usage

 Usage:
         po_generation_tool [OPTION] [INPUTFILE]...
 
 Extract translatable strings from given input Eiffel class files (*.e).
 INPUTFILE ...   input files
 -f              add list of input files
 -D              add list of directories to list for input files search
 -o              write output to specified file
                 If output file is -, output is written to standard output.
                 If output file is not specified, 'po_file.pot' will be generated as default name.
 -h              display this help and exit

Limitations

  • The tool now is not smart enough to identify a call of `translation' or `plural_translation' that is from an identifier of type I18N_LOCALE or others. This means that any call with the same name as `translation' and that takes one manifest string argument or with the same name as `plural_translation' and that takes two manifest string arguments is extracted.
  • Suggestion: Do not use a feature with signature like "translation(a_string: STRING_GENERAL)" or "plural_translation (a_string1: STRING_GENERAL; a_string2: STRING_GENERAL)" in your system, if i18n library and the tool are used.