FIX default language defined for IN country

This commit is contained in:
Laurent Destailleur
2021-09-20 13:20:54 +02:00
parent be2a95ca51
commit 0eff2fa15b
2 changed files with 19 additions and 5 deletions

View File

@@ -8192,8 +8192,8 @@ function picto_from_langcode($codelang, $moreatt = '')
* Return default language from country code.
* Return null if not found.
*
* @param string $countrycode Country code like 'US', 'FR', 'CA', 'ES', 'MX', ...
* @return string Value of locale like 'en_US', 'fr_FR', ...
* @param string $countrycode Country code like 'US', 'FR', 'CA', 'ES', 'IN', 'MX', ...
* @return string Value of locale like 'en_US', 'fr_FR', ... or null if not found
*/
function getLanguageCodeFromCountryCode($countrycode)
{
@@ -8243,12 +8243,12 @@ function getLanguageCodeFromCountryCode($countrycode)
'ar-SY',
'ar-TN',
'ar-YE',
'as-IN',
//'as-IN', // Moved after en-IN
'ba-RU',
'be-BY',
'bg-BG',
'bn-BD',
'bn-IN',
//'bn-IN', // Moved after en-IN
'bo-CN',
'br-FR',
'ca-ES',
@@ -8269,6 +8269,8 @@ function getLanguageCodeFromCountryCode($countrycode)
'en-GB',
'en-IE',
'en-IN',
'as-IN', // as-IN must be after en-IN (en in priority if country is IN)
'bn-IN', // bn-IN must be after en-IN (en in priority if country is IN)
'en-JM',
'en-MY',
'en-NZ',
@@ -8406,7 +8408,7 @@ function getLanguageCodeFromCountryCode($countrycode)
$locale_language = locale_get_primary_language($locale);
$locale_region = locale_get_region($locale);
if (strtoupper($countrycode) == $locale_region) {
//var_dump($locale.'-'.$locale_language.'-'.$locale_region);
//var_dump($locale.' - '.$locale_language.' - '.$locale_region);
return strtolower($locale_language).'_'.strtoupper($locale_region);
}
}