FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Using the automatic translation system

Description
This example employs message markup for translation (such as _c, writeln_) and also demnonstrates the use of annotations relating to the handling of messages.

The provided template file translate.pot (Portable Object Template) has been generated with the compilation option '-x':
mosel comp -x translate.mos -o translate.pot
For each supported language a separate PO (Portable Object) file needs to be generated using the xprnls command:
xprnls init -o translate.es.po translate.pot
The resulting PO file needs to be edited, completing its header by specifying the language and the encoding, and entering the desired translations.



Run the command below to generate the dictionaries or message catalogues (*.mo Machine Object files) from the provided translations (*.po files):
xprnls mogen -d locale *.po
The output will be contained in the subdirectory 'locale'.

Further explanation of this example: 'Mosel Language Reference', Section 2.20 Message translation


Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
translate.mos[download]

Data Files





translate.de.po

msgid ""
msgstr ""
"Language: de\n"
"Content-Type: text/plain; charset=ISO8859-1\n"

msgid "This is the %s day of the week\n"
msgstr "Das ist der %s Tag der Woche\n"

msgid "Today is %s\n"
msgstr "Heute ist %s\n"

msgid "first"
msgstr "erste"

msgid "fifth"
msgstr "fünfte"

msgid "fourth"
msgstr "vierte"

msgid "friday"
msgstr "Freitag"

msgid "monday"
msgstr "Montag"

msgid "no"
msgstr "nein"

msgid "saturday"
msgstr "Samstag"

msgid "second"
msgstr "zweite"

msgid "seventh"
msgstr "siebte"

msgid "sixth"
msgstr "sechste"

msgid "sunday"
msgstr "Sonntag"

msgid "third"
msgstr "dritte"

msgid "thursday"
msgstr "Donnerstag"

msgid "tuesday"
msgstr "Dienstag"

msgid "wednesday"
msgstr "Mittwoch"

msgid "yes"
msgstr "ja"


Back to examples browserPrevious exampleNext example