| capabilities.language Property | Flash 6 |
| the current language setting on the operating system | read/write |
The string language property contains a two-letter code representing the language used for text on the operating system. The cross-platform codes used are a subset of those in the ISO-639-1 standard, "Codes for the Representation of Names of Languages" (see http://lcweb.loc.gov/standards/iso639-2/englangn.html). For example, "en" indicates English, and "fr" indicates French. Where applicable, language also includes a two-letter country code indicating the local variant of the language, as defined by ISO 3166 (see http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html). A hyphen separates the language code from the country code, if both are present. For example, "en-UK" indicates English, United Kingdom variant.
By checking the language setting, a movie can intelligently provide text in the appropriate language for the user's system. Multiple language assets can be embedded directly into a single movie or loaded dynamically as variables, XML, or entire movies.
The corresponding server string for language is LAN, with possible values listed in Table 18-4. See capabilities.serverString for details.
|
Language |
ISO 639-1 language code |
ISO 3166 country code |
|---|---|---|
|
English, United States |
en |
US |
|
English, United Kingdom |
en |
UK |
|
French |
fr |
|
|
Korean |
ko |
|
|
Japanese |
ja |
|
|
Swedish |
sv |
|
|
German |
de |
|
|
Spanish |
es |
|
|
Italian |
it |
|
|
Simplified Chinese |
zh |
CN |
|
Traditional Chinese |
zh |
TW |
|
Portuguese |
pt |
|
|
Polish |
pl |
|
|
Hungarian |
hu |
|
|
Czech |
cs |
|
|
Turkish |
tr |
|
|
Finnish |
fi |
|
|
Danish |
da |
|
|
Norwegian |
no |
|
|
Dutch |
nl |
|
|
Russian |
ru |
|
|
Other/Unknown |
xu |
The English language country codes (UK and US) are not properly set by all versions of Flash Player 6; In both countries, System.capabilities.language returns "en" and does not include a country code.
The following code loads the English or French version of a movie, depending on the current language setting:
if (System.capabilities.language.substring(0,2) = = "en") {
trace("English language");
content_mc.loadMovie("news-english.swf");
} else if (System.capabilities.language = = "fr") {
trace("French language");
content_mc.loadMovie("news-french.swf");
}
Character Encoding," in Chapter 4