Locales and languages
How Servicely separates locales from languages, which properties control them, and how localised fields and date formats work.
A locale is a set of regional standards. A language is the set of translated messages users read. Administrators need the difference to decide what a multilingual instance supports and how dates and times appear.
Locales and languages are different
A locale covers how dates, times and numbers are presented. It also sets the names of the days, the first day of the week, and the 12 or 24 hour clock. A language is the translation of the product’s messages. A language pack, an application that holds only LocalizedMessage records, supplies one language.
Servicely names a locale as language_REGION, such as en_AU. It names a language by the locale of its main region, so English is en_US, not en, in scripts and platform code.
Several locales can share one language. United States English (en_US) and Australian English (en_AU) are different locales that use the same English messages. You can still localise a message for one locale only. For example, the message key trash.bin.name could read “Trash” in en_US and “Rubbish Bin” in en_AU. The base product does not include such variants.
The default locale and language are both en_US. English messages are stored in the applications themselves. Every other language comes from a language pack, which is not installed by default. See Install and generate language packs.
Servicely takes all locale information from the Unicode CLDR standard. Translations for many third-party interface components come with each locale. New locales arrive only with a new release of the platform.
Properties that control them
| Property | Default | Meaning |
|---|---|---|
system.multilingual |
false |
Turns on multiple languages in the interface, including the locale switcher and the localised message fields on some tables. |
| Property | Default | Meaning |
|---|---|---|
system.locale |
en_US |
The default locale for the instance. |
system.supported.locales |
en_US, en_AU, en_GB, en_ZA, fr_FR, de_DE, nl_NL, es_ES, es_CL, pt_BR, pt_PT, af_ZA, id_ID, ru_RU, hy_AM, uk_UA, th_TH, lo_LA, tr_TR, zh_CN, pl_PL, it_IT, cs_CZ, sk_SK, hu_HU |
The locales offered in the locale switcher and in Preferred language on a user record. |
system.supported.languages |
The same list as system.supported.locales |
The languages offered by the tools that generate localised messages. |
Edit the two lists to the locales and languages your instance supports. en_US is always supported, even if the properties are empty or missing. To change a property, see Set an application property.
Who sees more than one language
With system.multilingual set to true, every user gets a locale switcher in the menu bar. It lists the supported locales in the current locale’s language, with a flag for the current one. Choosing a locale changes the user’s Preferred language and reloads the page.
With system.multilingual set to false, the instance is still multilingual for holders of the language_editor role. They can switch languages, generate localisations and edit localised fields. Everyone else sees one language, chosen by their Preferred language, which they cannot change.
Localised fields
Some tables were built before they needed translation. They have a localised message field next to each translatable text field. The localised field is named after the original with Localized in front, so Description gains LocalizedDescription. On a form its label starts with “Display” and it follows the original field. Display templates use the localised field when it has a value, and the original field otherwise. The localised fields are hidden while system.multilingual is false.
| Table | Localised fields | Child tables |
|---|---|---|
TemplateReport |
LocalizedName, LocalizedDescription |
|
QuestionItem |
LocalizedName, LocalizedDescription, LocalizedSummary, LocalizedButtonText |
CatalogItem, RiskAssessmentItem |
Report |
LocalizedName, LocalizedDescription, LocalizedTitle |
|
Dashboard |
LocalizedName, LocalizedDescription |
ReportDashboard, PortalPage |
Question |
LocalizedSectionTitle |
|
CatalogCategory |
LocalizedName, LocalizedSummary |
On a catalog item, for example, the localised fields show as Display name, Display summary and Display button text.
Date and time formats
Servicely uses these default formats in every locale:
| Format | Default | Note |
|---|---|---|
| Short date | short |
|
| Long date | yMMMEd |
|
| Short time | short |
|
| Long time | medium |
|
| Short date time | short |
Often replaced by short date, a space and short time |
| Long date time | medium |
Often replaced by long date, a space and long time |
All defaults are CLDR skeleton formats. A skeleton, such as short or long, is an abstract format that each locale lays out its own way. A custom format spells out every element and its position, including indicators such as AM or PM.
To override a format for one locale, create a locale customization under Administration → Localisation → Locale customizations. Choose the Locale, enter the formats in CLDR form, and select the matching is skeleton box for each skeleton format. For a 24-hour clock, set the short and long time formats to HH:mm:ss, which shows 23:50:30. Add a to show AM or PM as well.
The older LocaleSettings table is no longer used. Locale customizations replace it, for date and time formats only.