FAQ

  1. Which languages are supported by SGI?
  2. What is WorldView?
  3. What is internationalization (I18N)?
  4. What is localization (L10N)?
  5. What is Unicode?
  6. What is a locale?
  7. What environment variables on the system define the locale setting?
  8. What code fragment should you put at the beginning of each program to ensure that locale is correctly set?
  9. When do you use message catalogs and when do you put strings in app-defaults files?
  10. If you need to write shell scripts that can post notifiers (xconfirm), where should the text for those notifiers go?

1. Which languages are supported by SGI?

As part of the base IRIX operating system we support over 30 locales. Fully localized desktops for French, German, Japanese, Chinese (Simplified and Traditional), and Korean are available with Worldview. For a complete list of the supported locales, click here.


2. What is WorldView?

The WorldView family of products merges international character sets and local conventions into the IRIX® User Environment of SGI® workstations. The WorldView architecture also supports third-party developers who design applications for the global marketplace.


3. What is Internationalization (I18N)?

Internationalization refers to the process of writing software so that it makes no assumptions about language and therefore is easier to localize into various languages.


4. What is Localization (L10N)?

Localization is the process of tailoring software and documentation to a specific language and region. Typically this distinction is by language, such as French in France or Japanese in Japan. However, localization also takes into account the usages and conventions in different locales, such as variations in the French of Belgium, Canada, France, and Switzerland. It is often abbreviated L10N because there are 10 letters between L and N.


5. What is Unicode?

The Unicode Standard is the universal character encoding standard used for representation of text for computer processing. It is fully compatible with the International Standard ISO/IEC 10646-1; 1993 and contains all the same characters and encoding points as ISO/IEC 10646. The Unicode Standard also provides additional information about the characters and their use. Any implementation that is conformant to Unicode is also conformant to ISO/IEC 10646.

Unicode provides a consistent way of encoding multilingual plain text and brings order to a chaotic state of affairs that has made it difficult to exchange text files internationally. Computer users who deal with multilingual text -- business people, linguists, researchers, scientists, and others -- will find that the Unicode Standard greatly simplifies their work.


6. What is a locale?

A locale specifies specific linguistic information and cultural conventions such as character type, collation, format of date and time, currency unit and messages. There is a locale database for each locale.

Locale name format is,
"language[_territory[.encoding]]".
(e.g. en_US, en_CA, hu, ko_KR.euc )

Each locale has several categories such as LC_CTYPE , LC_NUMERIC , LC_TIME , LC_COLLATE , LC_MONETARY , LC_MESSAGES , and LC_ALL. LC_ALL is a special category that represents all categories.


7. What environment variables on the system define the locale setting?

Programs that have been internationalized correctly use/refer to the following locale related environment variables.

  • LC_CTYPE
  • LC_NUMERIC
  • LC_TIME
  • LC_COLLATE
  • LC_MONETARY
  • LC_MESSAGES
  • LC_ALL (sets all categories to a locale)
  • LANG
You can set a locale value for each category. If a locale value is not set in a specific category's environment variable, the LANG environment variable is used for that category. Furthermore, if a locale is not set in the LANG environment variable, "C" locale (ASCII code set) is used.

Programs should not examine these environment variables directly.
You should always use the setlocale(< category >, NULL) function call to determine the settings for the various categories. In shell scripts, you should use the locale(1) command to determine the settings for each of the various categories.
Programs should seldom query LC_ALL. For example, if you want to look up localized messages or files, you should use LC_MESSAGES instead.


8. What code fragment should you put at the beginning of each program to ensure that locale is correctly set?

e.g.)

#include <locale.h>
...
main(int argc, char* argv[])
{
 ...
 if ( setlocale(LC_ALL, "") == NULL ) {
 /* error processing */
 }
 ...
Xt/Motif based programs:
...
main(int argc, char* argv[])
{
...
XtSetLanguageProc(NULL, NULL, NULL);
...
top = XtAppInitialize( ..... );
...

Or you can use your own language procedure:

...
main(int argc, char* argv[])
{
...
XtSetLanguageProc(NULL,myDefaultLanguageProc,NULL);
...
top = XtAppInitialize( ..... );
...


9. When do you use message catalogs and when do you put strings in app-defaults files?

Any program can use message catalogs. The app-defaults files can be used by Xt/Motif based programs.

Because most graphical user interface components such as labels and buttons have static strings, a simple resource setting (app-defaults) is usually sufficient. You have to use message catalogs for "usage" messages for example, because such messages should be displayed before the GUI is established.


10. If you need to write shell scripts that can post notifiers (xconfirm), where should the text for those notifiers go?

Should we have a standard shell script fragment that supports accessing correct text for notifiers, according to the locale?

You can use the gettxt command to get messages from message catalog files in shell scripts.

For example:

 #!/bin/sh
 message=`gettxt catalog_file_name:message_number_1`
 button=`gettxt catalog_file_name:message_number_2`
 xconfirm -b $button -t $message
or
 #!/bin/sh
 message_file=`gettxt catalog_file_name:message_number_3`
 button=`gettxt catalog_file_name:message_number_2`
 xconfirm -b $button -file $message_file