2
0
forked from Wavyzz/dolibarr

Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2019-04-03 18:52:47 +02:00

View File

@@ -7012,6 +7012,8 @@ function getLanguageCodeFromCountryCode($countrycode)
$buildprimarykeytotest = strtolower($countrycode).'-'.strtoupper($countrycode); $buildprimarykeytotest = strtolower($countrycode).'-'.strtoupper($countrycode);
if (in_array($buildprimarykeytotest, $locales)) return strtolower($countrycode).'_'.strtoupper($countrycode); if (in_array($buildprimarykeytotest, $locales)) return strtolower($countrycode).'_'.strtoupper($countrycode);
if (function_exists('locale_get_primary_language')) // Need extension php-intl
{
foreach ($locales as $locale) foreach ($locales as $locale)
{ {
$locale_language = locale_get_primary_language($locale); $locale_language = locale_get_primary_language($locale);
@@ -7022,6 +7024,11 @@ function getLanguageCodeFromCountryCode($countrycode)
return strtolower($locale_language).'_'.strtoupper($locale_region); return strtolower($locale_language).'_'.strtoupper($locale_region);
} }
} }
}
else
{
dol_syslog("Warning Exention php-intl is not available", LOG_WARNING);
}
return null; return null;
} }