Localization (Definition)

The process by which geographic, international and regional differences are managed.

JavaScript is used all over the world in a wide variety of environments, platforms and contexts. Portability issues arise when moving between platforms. They are also present when relocating a platform geographically. At the very least a time setting will need to change, and to record an event in a coordinated time framework, the offset from that known time reference needs to be known. There will be cultural, language and currency changes necessary as well as number formatting rule variations that need to be taken account of.

Indeed the differences in some locales may completely change the native alphabet that the user is prepared to work with. Even the direction of the text flow may change in extreme circumstances. Moving around Europe certainly requires that different accented symbols be used in each country.

Fortunately the Unicode standard covers a great many of these national variants.

Even so, JavaScript is fundamentally based on the American English language and even with the international support of the Unicode character set, the structural layout of the script source text may still conform to the underlying English language form. Even so there are issues with the spelling of words such as Color.

Typically, a localized implementation may allow the use of accented and national characters in identifier names but would still retain the English spelled keywords and punctuation characters.

As well as character sets, the issue of collation into the correct sorting sequence needs to be managed properly. In JavaScript, this issue is largely confined to the way that Array objects manage their sort() method's behavior.

Date and time formats tend to be arranged differently in each country. The United States and the United Kingdom commonly place the day number and month number the opposite way round. For day numbers above 12, this can be detected automatically but otherwise the context needs to be examined to decide which way round these values are.

Numeric formats may dictate a different punctuation symbol to be used for the decimal point and thousands separator. Confusingly, the comma and period characters may be used in both contexts. This means that a value could be misinterpreted and might yield a result that is several orders of magnitude in error when parsed.

Currency symbols will need some attention. The United States dollars symbol is in the lower 128 character set. The cents symbol is not. The UK pounds symbol is within the lowest 255 characters.

Warnings:

See also:Character set, Collation sequence, Currency symbol, Date and time, Decimal point (.), Multi-byte character