mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-06-28 01:06:58 +00:00
Sorting language available automatically
This commit is contained in:
parent
149a8e910d
commit
51ab8c556a
@ -2995,7 +2995,7 @@ class Locale:
|
|||||||
self.localePath = './static/locale/'
|
self.localePath = './static/locale/'
|
||||||
self.activeLanguages = {}
|
self.activeLanguages = {}
|
||||||
with open(os.path.join(f"{self.localePath}active_languages.json"), "r") as f:
|
with open(os.path.join(f"{self.localePath}active_languages.json"), "r") as f:
|
||||||
self.activeLanguages = json.loads(''.join(f.readlines()))
|
self.activeLanguages = sorted(json.loads(''.join(f.readlines())), key=lambda x : x['lang_name'])
|
||||||
|
|
||||||
def getLanguage(self) -> dict | None:
|
def getLanguage(self) -> dict | None:
|
||||||
currentLanguage = DashboardConfig.GetConfig("Server", "dashboard_language")[1]
|
currentLanguage = DashboardConfig.GetConfig("Server", "dashboard_language")[1]
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"lang_id": "ar-sa",
|
|
||||||
"lang_name": "Arabic",
|
|
||||||
"lang_name_localized": "العربية"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"lang_id": "zh-cn",
|
"lang_id": "zh-cn",
|
||||||
"lang_name": "Chinese (Simplified)",
|
"lang_name": "Chinese (Simplified)",
|
||||||
@ -24,6 +19,11 @@
|
|||||||
"lang_name": "Dutch",
|
"lang_name": "Dutch",
|
||||||
"lang_name_localized": "Nederlands"
|
"lang_name_localized": "Nederlands"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"lang_id": "ar-sa",
|
||||||
|
"lang_name": "Arabic",
|
||||||
|
"lang_name_localized": "العربية"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"lang_id": "en",
|
"lang_id": "en",
|
||||||
"lang_name": "English",
|
"lang_name": "English",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user