Foreign Language Translations

The RecordEditor now support Foreign Language Translations using the GetText Utility (see Windows or Linux). Currently the help screens are all in English, I will be looking at that in the future.

There are number of packages / services for PO files:

  1. TM DB is a translation tool that supports po files.
  2. poedit and Better pos editor are editors for po files. The RecordEditor can also edit po files using the GetText_PO layout.
  3. Eclipse users could try GTED (GetText Editor) for editing po files.
  4. po discussion lists a lot of tools that can be used with po files.
  5. pepipopum used to offer automatic translation of po files (using google translate).

Supplied Files:

FileDescription
ReMsgs_*.classSample Translations that can be selected in the RecordEditor. ReMsgs_tst.class is for my testing
ReMsgs_*.poSample Translations source files created using Google Translate. These all need updating. The RecordEditor can now has a very basic po file parser (po file must use encoding=utf8) and can use po file directly. Due to limitation with the po parser, the RecordEditor may not display the text correctly, but it should be good enough for a translator to work with. If there is both a class and po file, the RecordEditor will use the most recent file.

Problems with the Google Translation include

  • Mis-Translations, Some words in English (i.e. Record) have multiple meanings and the Google-Translate may pick the wrong meaning
  • Poor translation - A computer does not use a human like a person would.
  • Some messages contain HTML tags; these have been completely screwed up by the translation service.

Note: There is now a special message TranslationStatus where you can give status of the Translation. This is displayed when the RecordEditor starts. Once you are happy with the translation, set it to "".

msgfmt_GenerateResourceBundle.rexx/bat/shRexx / bat / shell scripts to convert ReMsgs_*.po to ReMsgs_*.class. This step requires a java compiler !!!. The options are:
  • Install the Java JDK (Java Development Kit) or Java SDK (Software development kit). A normal java installation does not include the java compiler javac. You will also need to either add the java jdk/sdk tools directory to the program path variable or setup a JAVAC variable that points to the compiler.
  • Look at Jikes compiler. Again you will need to setup a JAVAC variable.
  • Use the Eclipse Java compiler (ECJ), comes with Eclipse-JDT; I do not know of any standalone downloads. You would need to setup a JAVAC variable.

The gettext msgfmt program will call the Java Compiler (javac - SDK) program to compile the generated "Resource Bundle". There are sample rexx/bat/bash scripts to convert the po file into a java class file. Basically the scripts do (where tst is the foreign-language being generated and TextItems.tst.po is the input file) :


     msgfmt --java -d . -r ReMsgs -l tst TextItems.tst.po
     

Format of the RecordEditor PO Files

Each text translation will consist of:

  1. One or more comments lines starting with a #. In the RecordEditor po files, the typically comments will be a
  2. A msgid line this holds the text the RecordEditor will look for. In most cases it will be the original "English". The Exceptions are - Very large Text fields, Actions (Menu entries) and Values coming from external source (Database, Xml, Other packages). This field may contain variables in the form {0}, {1}, {2} etc, these will be substituted with actual values by the RecordEditor. You should use these same variables in your translated text. Also any text ending with : will probably have some error-message / object / text added to it by the RecordEditor.
  3. A msgstr where you enter the Translation
  4. One or more blank lines

Following are 2 sample Text entries:

378         
379 # Use: Field_Hint 
380 #  id:    Panel:  
381 # RecordBtns 3
382 msgid "Last Record"
383 msgstr "!!Last Record!!"
384         
385 # Use: External 
386 #  id: Copybook_Writers_0   Panel:  
387 # 
388 # English: RecordEditor (Tab) CSV
389 msgid "Copybook_Writers_0"      
390 msgstr "!!RecordEditor (Tab) CSV!!"

See GetText po Format for a description of PO files. There are many Text editors that can highlight po files (e.g. jEdit + some unix editors).

Changing the Language in the RecordEditor

To select your new language definition: