1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-22 07:10:09 +01:00

Merge pull request #492 from DaanSelen/language-template

Proposed changes
This commit is contained in:
Donald Zou 2024-11-15 11:52:13 +08:00 committed by GitHub
commit 1ece64abe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 37 additions and 34 deletions

View File

@ -4,7 +4,7 @@
"Password": "Wachtwoord",
"OTP from your authenticator": "OTP van uw authenticator",
"Sign In": "Inloggen",
"Signing In...": "Inloggen...",
"Signing In\\.\\.\\.": "Inloggen...",
"Access Remote Server": "Toegang tot Remote Server",
"Server": "Server",
"Click": "Klik",

View File

@ -4,7 +4,7 @@
"Password": "Parola",
"OTP from your authenticator": "Kimlik doğrulama uygulamanızdan tek kullanımlık parola",
"Sign In": "Giriş Yap",
"Signing In...": "Giriş Yapılıyor...",
"Signing In\\.\\.\\.": "Giriş Yapılıyor...",
"Access Remote Server": "Uzak Sunuculara Eriş",
"Server": "Sunucu",
"Click": "Tıkla",

View File

@ -236,6 +236,7 @@
"IP Address": "IP-адреса",
"Enter IP Address / Hostname": "Введіть IP-адресу / ім’я хоста",
"IP Address / Hostname": "IP-адресу / ім’я хоста",
"Dashboard IP Address \\& Listen Port": "",
"Count": "Граф",
"Geolocation": "",
"Is Alive": "",

View File

@ -15,36 +15,38 @@ print("Active Languages")
status = {}
for k in range(len(active_languages)):
print(f"[Language] {active_languages[k]['lang_name']}")
if active_languages[k]['lang_id'] != "en":
with open(f"{active_languages[k]['lang_id']}.json", "r") as f:
lang_file = json.loads(f.read())
missing_translation = []
deprecated_translation = []
for language in active_languages:
print(f"[Language] {language['lang_name']}")
for a in language_template.keys():
if a not in lang_file.keys():
missing_translation.append(a)
if language['lang_id'] != "en":
with open(f"{language['lang_id']}.json", "r") as f:
lang_file = json.load(f)
for b in lang_file.keys():
if b not in language_template.keys():
deprecated_translation.append(b)
# Identify missing and deprecated translations
missing_translation = [
key for key in language_template
if key not in lang_file or not lang_file[key].strip()
]
deprecated_translation = [
key for key in lang_file
if key not in language_template
]
print("\t[Missing Translations]")
if len(missing_translation) > 0:
for a in range(len(missing_translation)):
print(f'\t\t"{missing_translation[a]}": ""{(',' if a < len(missing_translation) - 1 else '')}')
else:
print("\t\tNo missing translations")
# Print missing translations
print("\t[Missing Translations]")
if missing_translation:
print(",\n".join(f'\t\t"{key}": ""'
for key in missing_translation))
else:
print("\t\tNo missing translations")
# Print deprecated translations
print("\n\t[Deprecated Translations]")
if deprecated_translation:
print("\n".join(f'\t\t"{key}": "{lang_file[key]}"'
for key in deprecated_translation))
else:
print("\t\tNo deprecated translations")
print("\n\t[Deprecated Translations]")
if len(deprecated_translation) > 0:
for a in range(len(deprecated_translation)):
print(f'\t\t"{deprecated_translation[a]}": "{lang_file[deprecated_translation[a]]}"')
else:
print("\t\tNo deprecated translations")
print()
print()