Multi-Site Manual / Version 2406.0
Table Of Contents
CoreMedia Multi-Site relies on the representations of locales as provided
by Java. For best support for your locale you should check
Locale.getAvailableLocales()
to contain
your locale.
Providing customized locales is best sketched with
Locale.Builder
. Use it to create your locale and
use the resulting Locale.toLanguageTag()
for your Multi-Site configuration.
new Locale.Builder() // Base on existing locale. .setLocale(Locale.US) // ! Not part of Display Name ! .setExtension(Locale.PRIVATE_USE_EXTENSION, "myExt") // Registered by IANA; Qaaa - Qabx for private use .setScript("Latf") // Custom key-value pairs. .setUnicodeLocaleKeyword("lK", "local-value") // Registered by IANA .setVariant("1994") .build() .toLanguageTag()
Example 3.1. Creating Locale with Locale.Builder
Beware of Locale.toString()
Especially in context of CoreMedia Multi-Site you should not rely on the
representation of Locale.toString()
, which, at
first glance seems to be a language tag, just using underscores such as
en_US
. In contrast to IETF BCP 47 language tags
this representation has no strict specification and as such cannot
reliably be parsed from String representation back to a valid
Locale
. Use #toLanguageTag
instead.