aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc/get_ui_language.php
diff options
context:
space:
mode:
Diffstat (limited to 'misc/get_ui_language.php')
-rw-r--r--misc/get_ui_language.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc/get_ui_language.php b/misc/get_ui_language.php
index b1305b3..712b6c5 100644
--- a/misc/get_ui_language.php
+++ b/misc/get_ui_language.php
@@ -4,8 +4,8 @@ function get_ui_language(?array $possibleLanguages = null): string {
if ($possibleLanguages == null) {
$possibleLanguages = array_map(function ($path) {
$parts = explode('/', $path);
- return $parts[count($parts) - 2];
- }, glob(__DIR__ . '/../locale/*/LC_MESSAGES'));
+ return str_replace('.json', '', $parts[count($parts) - 1]);
+ }, glob(__DIR__ . '/../locale/*.json'));
}
if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {