Difference between revisions of "Po generation tool"

 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Tools]]
 
[[Category:Tools]]
 +
[[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://svn.origo.ethz.ch/eiffelstudio/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 ==
 
   Usage:
 
   Usage:
           po_generation_tool [OPTION] [INPUTFILE]...
+
           po_generation_tool (-f|-D) INPUTFILE [(-f|-D) INPUTFILE] ... [-o OUTPUT]|[-]
 +
 
 +
  Example:
 +
          po_generation_tool -f class1.e class2.e
 +
          po_generation_tool -D dir1 dir2 -o out.pot
 
    
 
    
 
   Extract translatable strings from given input Eiffel class files (*.e).
 
   Extract translatable strings from given input Eiffel class files (*.e).
  
   INPUTFILE ...  input files
+
   INPUTFILE ...  input files or directories
 
   -f              add list of input files
 
   -f              add list of input files
 
   -D              add list of directories to list for input files search
 
   -D              add list of directories to list for input files search
Line 18: Line 31:
  
 
== 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.

Latest revision as of 21:12, 4 November 2010

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 (-f|-D) INPUTFILE [(-f|-D) INPUTFILE] ... [-o OUTPUT]|[-]
 Example:
         po_generation_tool -f class1.e class2.e
         po_generation_tool -D dir1 dir2 -o out.pot
 
 Extract translatable strings from given input Eiffel class files (*.e).
 INPUTFILE ...   input files or directories
 -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.