Load locales clean folder path (#875)
* Fix locale folder path when reading locale list * Ensure / directory separaor isn't left against locale name
This commit is contained in:
parent
bf00f0cc5f
commit
11575ef3c4
|
@ -2207,8 +2207,8 @@ class Calculation
|
||||||
private static function loadLocales()
|
private static function loadLocales()
|
||||||
{
|
{
|
||||||
$localeFileDirectory = __DIR__ . '/locale/';
|
$localeFileDirectory = __DIR__ . '/locale/';
|
||||||
foreach (glob($localeFileDirectory . '/*', GLOB_ONLYDIR) as $filename) {
|
foreach (glob($localeFileDirectory . '*', GLOB_ONLYDIR) as $filename) {
|
||||||
$filename = substr($filename, strlen($localeFileDirectory) + 1);
|
$filename = substr($filename, strlen($localeFileDirectory));
|
||||||
if ($filename != 'en') {
|
if ($filename != 'en') {
|
||||||
self::$validLocaleLanguages[] = $filename;
|
self::$validLocaleLanguages[] = $filename;
|
||||||
}
|
}
|
||||||
|
@ -2413,7 +2413,6 @@ class Calculation
|
||||||
if (strpos($locale, '_') !== false) {
|
if (strpos($locale, '_') !== false) {
|
||||||
list($language) = explode('_', $locale);
|
list($language) = explode('_', $locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count(self::$validLocaleLanguages) == 1) {
|
if (count(self::$validLocaleLanguages) == 1) {
|
||||||
self::loadLocales();
|
self::loadLocales();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue