Introduction to locale settings

Applications use TLocale as their reference for the conventions in use on a particular device.

Conventions used for representing locale sensitive information, for example date and time formatting, the currency symbol and units of measurement are encapsulated by the TLocale class.

Using this class, applications can set and retrieve:

  • the country code — up to 3 digits corresponding to the international dialling prefix

  • the currency format — including whether the currency symbol occurs before or after, whether negative values are represented with brackets or a minus sign and whether triads are allowed. Note that the currency symbol cannot be set from within TLocale. Use User::SetCurrencySymbol() to set the currency symbol and the TCurrencySymbol class to retrieve it.

  • numeric values — the thousands separator, and decimal separator characters

  • date and time format — for example, instance separator characters, ordering of date components, positioning of am/pm text

  • calendar settings — the first day of the week, which days are work days

  • time zone information — a locale’s time offset from universal time, the zones in which daylight saving is in effect

  • units of measurement — imperial or metric

Functions are provided for getting these values, which all applications should honour. Functions are also provided for setting them, which should normally only be used by a customisation application.