Internationalization > Rogue Wave Views Locale Support
 
Rogue Wave Views Locale Support
Although locale names are system-dependent, and each system has its own way of identifying the locale information, Rogue Wave® Views supports a system-independent scheme for localization.
Rogue Wave Views Locale Names
For Rogue Wave Views to use locale-dependent information in a system-independent way, Rogue Wave Views defines the concept of an Rogue Wave Views locale, whose name is system-independent. This locale has the following format:
ll_TT.encoding
where:
ll is a two-letter, lowercase abbreviation of the language name.
TT is a two-letter, uppercase abbreviation of the territory name.
encoding is a string that identifies the code set or encoding method used.
For example, in the Rogue Wave Views locale name fr_FR.ISO‑8859‑1, the fr represents the language name, French; the FR represents the territory name, France; ISO‑8859‑1 represents the encoding method used for the language, which is ISO 8859‑1.
The following examples show several Rogue Wave Views locale names on UNIX platforms:
* fr_FR.ISO-8859-1
* de_DE.ISO-8859-1
*ja_JP.EUC-JP
* ja_JP.Shift_JIS
The following examples show several Rogue Wave Views locale names on Windows platforms:
*fr_FR.windows-1252
*de_DE.windows-1252
*ja_JP.Shift_JIS
Language Name Specification
In the Rogue Wave Views locale, the language names are specified using the abbreviations from the ISO 639 Code for the Representation of Names of Languages. Here are several examples:
*en (English)
*fr (French)
*de (German, from “Deutsch”)
*ja (Japanese)
The ISO 639 standard can be consulted on the following Web sites:
http://www.loc.gov/standards/iso639-2/ascii_8bits.html
or ftp://std.dkuug.dk/i18n/iso-639-2.txt
More generally, ISO codes can be consulted on the following Web site:
http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_639.html
Territory Name Specification
In the Rogue Wave Views locale, the territory names are specified using the abbreviations from the ISO 3166 Codes for the Representation of Names of Countries.
The ISO 3166 standard can be consulted on the following Web site:
http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm
Here are several examples:
*US (United States)
*NL (the Netherlands)
*FR (France)
*DE (Germany, from “Deutschland”)
*JP (Japan)
Encoding Specification
In the Rogue Wave Views locale, the encoding identifies the code set or encoding method used for the language. Examples of encoding methods are:
*ISO-8859-1 (ISO 8859/1)
*Shift_JIS (Shift Japanese Industrial Standard)
Any character encoding registered by IANA could be used. Currently only character sets listed in Reference: Encoding Listings are supported by Rogue Wave Views, which tends to use the preferred MIME notation.
For more information, you can consult the following Web site:
http://www.iana.org/assignments/character-sets
Determining Rogue Wave Views Support for the Locale
To determine if Rogue Wave Views supports the desired locale, you can run the following program:
Note: This example uses private code that you should not use in a real application.
// -------------------------------------------------------------- -*- C++ -*-
// File: doc/fondation/userman/src/internationalization/checkViewsLocale.cpp
// --------------------------------------------------------------------------
// Copyright (C) 1990-2008 by ILOG.
// All Rights Reserved.
// --------------------------------------------------------------------------
 
#include <ilviews/ilv.h>
#include <ilviews/base/locale.h>
 
int main(int argc, char* argv[])
{
if (!IlvSetLocale()) {
exit(1);
}
char* stdLocale = IlLocale::GetStdLocaleName(setlocale(LC_CTYPE, NULL));
if (stdLocale)
IlvPrint("Standard Views locale name: %s\n", stdLocale);
else
IlvPrint("Views does not support this locale.\n");
 
return 0;
}
 
For example, on an HP-UX system with your LANG set to fr_FR.iso88591 or on a Solaris system with your LANG set to fr, you get the following result:
Standard Views locale name: fr_FR.ISO-8859-1
On a Windows system set to Japanese, you get:
Standard Views locale name: ja_JP.Shift_JIS

Version 5.5.1
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.