aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc/get_ui_language.php
diff options
context:
space:
mode:
authorwinter2024-12-31 14:30:16 +0000
committerwinter2024-12-31 14:30:16 +0000
commitad554b48e7dc355d9b33eede98f4e3e829fd867e (patch)
treeeb11cd4357bdbe2964b9d04495ab2e6c7212d9ed /misc/get_ui_language.php
parent721674973ca0a4d98cd081e9ff130c3356ddac03 (diff)
switch to my own translations system
i really don't like gettext
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'])) {