|Version 3 (modified by 15 years ago) ( diff ),|
MapGuide RFC 45 - Enhanced Locale Support
This page contains an change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.
|RFC Template Version||1.0|
|Submission Date||Jan 23, 2008|
|Last Modified||Walt Welton-Lair Timestamp|
|Author||Walt Welton-Lair, Trevor Wekel|
|Assigned PSC guide(s)||Tom Fukushima|
|Voting History||(vote date)|
MapGuide currently supports specifying locales using two-letter language codes from the ISO 639-1 standard, e.g. LOCALE=en. We need to extend this to support locales encoded as [language]-[country], as allowed by the HTTP Accept-Language header (e.g. en-us or en-gb).
A two-letter language code is sometimes insufficient to distinguish between the different variations of a language. Chinese is a good example. Using just a two-letter language code ("zh" for Chinese) does not allow a localization distinction between the two languages "Simplified Chinese" and "Traditional Chinese". However with the proposed extended format these would be encoded as "zh-CN" and "zh-TW".
For MapGuide, the HTTP Accept-Language header is a reasonable way to determine the language:
The value of the header is generally encoded as [language]-[country], such as en-us, en-gb, zh-cn, or zh-tw. The country can be upper or lower case. HTTP also accepts just "en" or "zh".
MapGuide platform code will be extended to accept both formats. Resource filenames would also follow this convention (e.g. "mapguide_zh-CN.res", or just "mapguide_zh.res"). A browser can make a request using either the extended format ("zh-CN") or the basic format ("zh"). If the extended format is requested and those resources are not found, then we default to the basic format. In other words, "zh-CN" should default to using "zh" resources if "zh-CN" resources are not present.
When providing resource files that use the extended format, a default file that uses the basic format must also be provided. This can simply be a copy of one of the extended versions.
Supplied by Autodesk.