CakeFest 2024: The Official CakePHP Conference

Locale::canonicalize

locale_canonicalize

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)

Locale::canonicalize -- locale_canonicalizeCanonicalize the locale string

Beschreibung

public static Locale::canonicalize(string $locale): ?string

Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Parameter zur Verfügung.

Parameter-Liste

locale

Rückgabewerte

Canonicalized locale string.

Gibt null zurück, wenn die Länge von locale INTL_MAX_LOCALE_LEN überschreitet.

add a note

User Contributed Notes 1 note

up
3
jerome at chaman dot ca
8 years ago
this method performs Level 1 and Level 2 canonicalization according to ICU standards. See http://userguide.icu-project.org/locale#TOC-Canonicalization.

echo \Locale::canonicalize ( 'en-US.utf8' );
// "en_U"
echo \Locale::canonicalize ( 'FR-fr@EURO' );
// "fr_FR@currency=EUR"
echo \Locale::canonicalize ( '' );
// "en_US_POSIX"
To Top