Using the automatic translation system
|
|
Type: | Programming |
Rating: | 2 (easy-medium) |
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': For each supported language a separate PO (Portable Object) file needs to be generated using the xprnls command: 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): The output will be contained in the subdirectory 'locale'. |
File(s): | translate.mos |
Data file(s): | translate.de.po, translate.fr.po, translate.pot |
|
translate.mos |
(!******************************************************* * Mosel Example Programs * * ====================== * * * * file tanslate.mos * * ````````````````` * * Example for the use of the Mosel language * * (use of the automatic translation system) * * run the command below to generate the dictionaries: * * xprnls mogen -d locale *.po * * * * (c) 2015 Fair Isaac Corporation * * author: Y. Colombani, 2015 * *******************************************************!) model translate !@mc.msgdom translate uses 'mmsystem' declarations weekday:array(1..7) of string worder:array(1..7) of string end-declarations !@mc.msgid yes !@mc.msgid no weekday::[_c("monday","tuesday","wednesday","thursday", "friday","saturday","sunday")] worder::[_c("first","second","third","fourth","fifth","sixth","seventh")] wd:=getweekday(date(SYS_NOW)) writeln_("Today is ",_(weekday(wd))) writeln_("This is the ",_(worder(wd))," day of the week") end-model |
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.