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

Data Files





translate.pot

# Created by Mosel v3.13.0 from 'translate.mos'
# Domain name: translate

msgid "This is the %s day of the week\n"
msgstr ""

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

msgid "fifth"
msgstr ""

msgid "first"
msgstr ""

msgid "fourth"
msgstr ""

msgid "friday"
msgstr ""

msgid "monday"
msgstr ""

msgid "no"
msgstr ""

msgid "saturday"
msgstr ""

msgid "second"
msgstr ""

msgid "seventh"
msgstr ""

msgid "sixth"
msgstr ""

msgid "sunday"
msgstr ""

msgid "third"
msgstr ""

msgid "thursday"
msgstr ""

msgid "tuesday"
msgstr ""

msgid "wednesday"
msgstr ""

msgid "yes"
msgstr ""

Back to examples browserPrevious exampleNext example