function Request::getLanguageCombinations
Returns an array of all possible combinations of the language components.
For instance, if the locale is "fr_Latn_FR", this method will return:
- "fr_Latn_FR"
- "fr_Latn"
- "fr_FR"
- "fr"
Return value
string[]
1 call to Request::getLanguageCombinations()
- Request::getPreferredLanguage in vendor/
symfony/ http-foundation/ Request.php - Returns the preferred language.
File
-
vendor/
symfony/ http-foundation/ Request.php, line 1626
Class
- Request
- Request represents an HTTP request.
Namespace
Symfony\Component\HttpFoundationCode
private static function getLanguageCombinations(string $locale) : array {
[
$language,
$script,
$region,
] = self::getLanguageComponents($locale);
return array_unique([
implode('_', array_filter([
$language,
$script,
$region,
])),
implode('_', array_filter([
$language,
$script,
])),
implode('_', array_filter([
$language,
$region,
])),
$language,
]);
}