mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Make Icinga\Util\Tranlsator not only return locale codes with encodings
refs #6602
This commit is contained in:
parent
e3b2f15863
commit
b3cb29d804
@ -141,17 +141,18 @@ class Translator
|
|||||||
public static function getAvailableLocaleCodes()
|
public static function getAvailableLocaleCodes()
|
||||||
{
|
{
|
||||||
$codes = array();
|
$codes = array();
|
||||||
$postfix = '.UTF-8';
|
|
||||||
foreach (array_values(self::$knownDomains) as $directory) {
|
foreach (array_values(self::$knownDomains) as $directory) {
|
||||||
$dh = opendir($directory);
|
$dh = opendir($directory);
|
||||||
while (false !== ($name = readdir($dh))) {
|
while (false !== ($name = readdir($dh))) {
|
||||||
if (substr($name, 0, 1) === '.') continue;
|
if (substr($name, 0, 1) !== '.'
|
||||||
if (substr($name, -6) !== $postfix) continue;
|
&& false === in_array($name, $codes)
|
||||||
if (is_dir($directory . DIRECTORY_SEPARATOR . $name)) {
|
&& is_dir($directory . DIRECTORY_SEPARATOR . $name)
|
||||||
$codes[] = substr($name, 0, -6);
|
) {
|
||||||
|
$codes[] = $name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $codes;
|
return $codes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user