From ad554b48e7dc355d9b33eede98f4e3e829fd867e Mon Sep 17 00:00:00 2001 From: winter Date: Tue, 31 Dec 2024 14:30:16 +0000 Subject: switch to my own translations system i really don't like gettext --- misc/__.php | 7 +++++++ misc/get_ui_language.php | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 misc/__.php (limited to 'misc') diff --git a/misc/__.php b/misc/__.php new file mode 100644 index 0000000..af6366a --- /dev/null +++ b/misc/__.php @@ -0,0 +1,7 @@ +__tostring(); +} \ No newline at end of file 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'])) { -- cgit v1.3