Skip to the content
Documentation

Configuring your site locale

No ratings yet

The locale of a siteaccess decides the language of the interface texts (when TextTranslation is enabled) and how dates, times, numbers and amounts are written, for example by the l10n template operator. It is set with site.ini [RegionalSettings] Locale. The shipped value in settings/site.ini is eng-GB; the setup wizard writes the default language you choose into each siteaccess it creates.

The locale is not the language of the content: that is SiteLanguageList[] (see Configuring the site languages).

One locale for every siteaccess

# settings/override/site.ini.append.php
[RegionalSettings]
Locale=nor-NO
TextTranslation=enabled

Then clear the INI caches (php bin/php/ezcache.php --clear-tag=ini). Every siteaccess without its own Locale now uses share/locale/nor-NO.ini.

A locale for one siteaccess

Put the same lines in site.ini.append.php in settings/siteaccess/<siteaccess>/. With Locale=ger-DE and TextTranslation=enabled in the administration siteaccess, the administration interface is in German. The siteaccess's SiteLanguageList[] is not affected, so the content it lists can still be in another language.

Signed-in users of the administration can also choose the interface language for themselves, in the right-hand column under Interface language. Setup > Interface languages lists every locale with how much of the kernel and of each extension is translated.

The locales that ship

share/locale/ holds one file per locale, more than 380 in 6.0.15 including the variations ([email protected], [email protected] and others). The translations of the interface texts are in share/translations/<locale>/translation.ts and in the translations/ directory of each extension. A locale without a translation of its own falls back to another translation of the same language (fre-NC to fre-FR), as i18n.ini [TranslationSettings] configures; ./console exp:i18n fallbacks shows the chain of every locale.

Languages in Exponential lists every locale with its native name, region and support level, and every administration translation.

A locale of your own

Do not edit a shipped locale file: an upgrade replaces it. To change a few values, create a variation: a file named <locale>@<name>.ini that holds only the keys it changes, for example share/locale/[email protected], and set Locale=nor-NO@custom. A variation first loads its locale and that locale's translation.

For a locale that does not exist, copy the closest file to a new name (share/locale/ice-IS.ini from another locale) and adjust it. The code is three letters for the language (ISO 639-2), a dash and two upper-case letters for the country (ISO 3166-1). The groups a locale file has are [RegionalSettings], [Charset], [HTTP], [Currency], [Numbers], [DateTime], the month and day names and, optionally, [LanguageSettings] TextDirection=rtl and [CountryNames]. Section 7 of Languages in Exponential describes every key.

A new locale without a translation of its own shows the English source texts unless it falls back to a translation: name one in i18n.ini [TranslationSettings] FallbackLanguages[<locale>], or let the automatic fallback to the same language apply.

Checking a translation

./console exp:ezchecktranslation ger-DE   # statistics of one translation
./console exp:i18n fallbacks --locale=ger-AT
./console exp:i18n check                  # exit code 1 on a problem

History

Earlier versions of this page sent translators to the translation project of the eZ Publish community site, which is closed. The locales and translations of Exponential are maintained in the kernel repository today; see section 8 of Languages in Exponential for adding or completing a translation.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.