DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Introduction to the Form and Menu Language Interpreter (FMLI)

Writing an internationalized application

Internationalized FMLI applications are applications whose language dependent output is not hard-coded in the frame definition files. The output (messages, menu items, frame titles, and so on) are encoded in a language-independent way in the definition file. At run-time, that is, when interpreting the respective file, FMLI retrieves the language-dependent output from a message catalogue which contains the output of the application in the language to which the system locale is set. If no message catalogue exists, FMLI tries to output a default message encoded in the frame definition file. If a default message does not exist either, you get the following message:

   Message not found!
Writing an internationalized application requires that all strings that are to be presented on the screen must be described using the special syntax:
   "$$<catalogue_name>:<message_no.>:<default_message>"

catalogue_name
denotes the name of the catalogue in which the messages for a certain locale are stored. It can be stored in /usr/lib/locale/<locale>/LC_MESSAGES using the UNIX utility mkmsgs.

message_no
is the index to the respective message in the message catalogue.

default_message
is the message that is displayed if the locale is set to ``C'' or if no message catalogue exists in the current locale.
The menu frame definition file shown in ``Menu.sample: a simple menu frame definition file'' would then look like this:
   menu="$$uxmyapp:1:TOP MENU"
   

name="$$uxmyapp:2:date" action=`date | message`nop

name="$$uxmyapp:3:welcome" action=open Text.welcome

name="$$uxmyapp:4:exit" action=exit

Menu.sample: a simple international menu definition file

If you want your menu to be sorted automatically in any locale, you must indicate this by using the descriptor autosort. If it is set to autosort=true, the menu items will be presented in alphabetical order in any language. This would be independent from the order in the actual frame definition file.

The second menu item in ``Menu.sample: a simple international menu definition file'' would invoke an opening action on the file Text.welcome. It is stored in the current directory. If the application is to open a textfile that is translated to another language than the default, this textfile must be stored in the directory ./$LANG/<file>. If the file Text.welcome was translated to German and if the application was to open that file, it would have to be stored in the directory ./De_DE.88591 carrying the same name. FMLI automatically checks the locale before opening a textfile.


Next topic: Using an FMLI application
Previous topic: Text.welcome: a text frame definition file

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004