lithium\g11n\Locale::canonicalize()
Returns a locale in its canonical form with tags formatted properly.
Parameters
-
string
$locale
A locale in an arbitrary form (i.e.
'ZH-HANS-HK_REVISED'
).
Returns
stringA locale in its canonical form (i.e. 'zh_Hans_HK_REVISED'
).
Source
public static function canonicalize($locale) {
$tags = static::decompose($locale);
foreach ($tags as $name => &$tag) {
foreach ((array) static::$_tags[$name]['formatter'] as $formatter) {
$tag = $formatter($tag);
}
}
return static::compose($tags);
}