Multi-Site Manual / Version 2412.0
Table Of ContentsGuess, you are about to create a global site, which is supposed to serve as an abstract site (see Abstract Sites). You want to have a nice, distinguishable name for this site, displayed in CoreMedia Studio, but you do not want to collide with any regular locales within your site hierarchy.
The World Region 001
As already stated in the
Introduction,
a possible alternative to approaches mentioned here about a
Global locale, you may as well consider using
existing registered region subtags, such as 001
,
to represent the region World.
Your first guess for a nice representation within Studio is a string like English (Global). As stated in Section 3.2.1, “Defining Valid Language Tags” there is no option to directly customize the display name of a locale. Instead, it is time to get creative with means how to build locales matching your needs for a proper display name.
Pragmatic: Let's first come to the
pragmatic approach. Knowing that most of the time it is the country or
region that is displayed in parentheses, you will soon identify that there
is no such country available. But you will get the same result regarding
the desired display name English (Global) by using
variants. In general, you should stick to those variants registered at
IANA. But: Java does not validate against registered variants. So, you
may use any variant you like if it is well-formed. The solution
here is the following valid language tag:
en-Global
. It will create a locale with language English,
with no country/region set, and with a variant Global
.
Compliant: If you are eager to stick
to the specification, you may use the Unicode Locale Keyword extension
for your custom locale. The following language tag is compliant with
the specification and will create a locale with language English, with
no country/region set, and with a Unicode Locale Keyword extension
for key tp
(for: type) and value
global
: en-u-tp-Global
.
When querying the display name for the language tag
en-u-tp-Global
, you will get:
English (tp: global).
To experiment with more viable options, also directly validating if you have a valid language tag, you may want to look at Section “Tip: Design Help Via Java's Locale”.
Common Locale Data Repository (CLDR)
Since Java 9 the JDK uses the Common Locale Data Repository (CLDR) for locale data. JEP 252 (Use CLDR Locale Data by Default) introduced this resource and emphasized, that this approach may also trigger changes to the display names of locales by revisions of the CLDR locale data in future JDK releases.