Global Internet applications must be aware of the user locale. Locale-sensitive functions, such as date, time, and monetary formatting, are built into programming environments such as Java and SQL. Applications can use locale-sensitive functions to format the HTML pages according to the cultural conventions of the user locale.
Different programming environments represent locales in different ways. For example, the French (Canadian) locale is represented as follows:
Environment | Representation | Locale | Explanation |
---|---|---|---|
Java |
Java locale object |
|
Java uses the ISO language and country code.
|
SQL and PL/SQL |
|
|
Refer to the "Working in a Global Environment" chapter in the Oracle Database 2 Day Developer's Guide. |
Table 9-1 shows how some of the commonly used locales are defined in Java and Oracle environments.
Table 9-1 Locale Representation in Java, SQL, and PL/SQL Programming Environments
Locale | Java | NLS_LANGUAGE, NLS_TERRITORY |
---|---|---|
Chinese (P.R.C) |
|
|
Chinese (Taiwan) |
|
|
English (U.S.A) |
|
|
English (United Kingdom) |
|
|
French (Canada) |
|
|
French (France) |
|
|
German (Germany) |
|
|
Italian (Italy) |
|
|
Japanese (Japan) |
|
|
Korean (Korea) |
|
|
Portuguese (Brazil) |
|
|
Portuguese (Portugal) |
|
|
Spanish (Spain) |
|
|
When writing global applications across different programming environments, the user locale settings must be synchronized between environments. For example, Java applications that call PL/SQL procedures should map the Java locales to the corresponding NLS_LANGUAGE
and NLS_TERRITORY
values and change the parameter values to match the user locale before calling the PL/SQL procedures.