Locale::minimizeSubtags
PHP function
Edit on GitHub ✎
Remove likely subtags from a locale
Description
Oop
Locale::minimizeSubtags(string $locale): string|false
Procedural
locale_minimize_subtags(string $locale): string|false
Minimizes a locale tag by removing subtags that can be inferred using the ICU likely subtag data. For example, en_Latn_US becomes en.
Parameters
localeThe locale to minimize.
Return Values
Returns the locale with likely subtags removed, or false on failure.
Errors/Exceptions
Throws a ValueError when the locale argument contains null bytes.
See Also
Locale::addLikelySubtagsLocale::canonicalize