This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
language.py
98 lines (78 loc) · 2.83 KB
/
language.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/python3
import json
import os
import app
from createfile import *
# Make valid lang file
languages = ["englis", "hungary"]
for langFile in languages:
with open("/home/{}/lsu/locales/{}.json".format(os.getlogin(), langFile), "r+", encoding='utf8') as writeFile:
file = json.load(writeFile)
file["app"]["version"] = "Version: {}".format(app.__version__) if langFile == "englis" else "Verzió: {}".format(app.__version__)
writeFile.seek(0)
json.dump(file, writeFile, indent=3, ensure_ascii=False)
writeFile.truncate()
# Set language
read_lang_file = open("/home/{}/lsu/files/app.json".format(os.getlogin()), "r")
getLang = json.load(read_lang_file)
if getLang["language"] == "English":
eng_lang = open("/home/{}/lsu/locales/englis.json".format(os.getlogin()), "r")
lang = json.load(eng_lang)
elif getLang["language"] == "Hungary":
hun_lang = open("/home/{}/lsu/locales/hungary.json".format(os.getlogin()), "r")
lang = json.load(hun_lang)
# Name of window(s)
lsu = lang["window_name"]["lsu"]
settings = lang["window_name"]["settings"]
# Titles
t_systm_updater = lang["titles"]["systm_updater"]
t_modul = lang["titles"]["modul"]
t_language = lang["titles"]["language"]
t_editor = lang["titles"]["editor"]
# Button(s)
btn_lsu_sys = lang["buttons"]["lsu_sys"]
btn_lsu_web = lang["buttons"]["lsu_web"]
btn_lsu_github = lang["buttons"]["lsu_github"]
# Modul
m_node = lang["modul"]["node"]
m_pm2 = lang["modul"]["pm2"]
# Language
l_eng = lang["language"]["eng"]
l_hu = lang["language"]["hun"]
# Menu Line
ml_lsu_menu = lang["menu_line"]["lsu_menu"]
ml_lsu_news = lang["menu_line"]["lsu_news"]
ml_lsu_info = lang["menu_line"]["lsu_info"]
ml_stngs_menu = lang["menu_line"]["stngs_menu"]
ml_stngs_modul = lang["menu_line"]["stngs_modul"]
# LSU Menu
lm_supsys = lang["lsu_menu"]["supsys"]
lm_about = lang["lsu_menu"]["about"]
lm_settings = lang["lsu_menu"]["settings"]
lm_exit = lang["lsu_menu"]["exit"]
# LSU News
ln_questionaire = lang["lsu_news"]["questionaire"]
# LSU Info
li_log_file = lang["lsu_info"]["log_file"]
li_last_log = lang["lsu_info"]["last_log"]
li_sysinfo = lang["lsu_info"]["sysinfo"]
# Settings Menu
sm_whatis = lang["stngs_menu"]["whatis"]
# Settings Modul
sm_node = lang["stngs_modul"]["node"]
sm_pm2 = lang["stngs_modul"]["pm2"]
# Title of Messagebox
tm_notify = lang["msgbox_title"]["notify"]
tm_error = lang["msgbox_title"]["error"]
tm_howtouse = lang["msgbox_title"]["howtouse"]
tm_supsys = lang["msgbox_title"]["supsys"]
tm_sysinfo = lang["msgbox_title"]["sysinfo"]
tm_about = lang["msgbox_title"]["about"]
tm_lastlog = lang["msgbox_title"]["lastlog"]
# Description of Messagebox
dm_restart = lang["msgbox_des"]["restart"]
dm_howtouse = lang["msgbox_des"]["howtouse"]
dm_about = lang["msgbox_des"]["about"]
dm_lang_res = lang["msgbox_des"]["lang_res"]
# AppInfo
appi = lang["app"]["version"]