$LANG_LOCALE_SEPARATOR
$LANG_LOCALE_SEPARATOR :
Parses the Accept-Language header.
parse( $acceptLanguage)
Returns the lang locale with the highest weight from the Accept-Language header.
$acceptLanguage |
__construct()
Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275
getWeight( $languageLocaleWeight)
$languageLocaleWeight |
isValidLanguageLocale( $languageLocale)
$languageLocale |
isBetterLanguageLocale( $weight, $bestWeight, $languageLocale, $bestLanguageLocale)
Prefer the new lang locale if: the new weight is greater than the current one OR if the weights are even AND the current lang locale only contains language and the new one contains language and locale.
$weight | ||
$bestWeight | ||
$languageLocale | ||
$bestLanguageLocale |
isBestLanguageLocale( $languageLocale, $weight)
The best lang locale is one that contains both language and locale and where the weight is 1 (max).
$languageLocale | ||
$weight |