Add option to disable language files through config.json

This commit is contained in:
Andrew 2022-03-02 10:30:40 -05:00
parent 826d4d081f
commit 8e874ca997
2 changed files with 8 additions and 5 deletions

View File

@ -606,10 +606,11 @@ class PanelHandler(BaseHandler):
page_data['super-disabled'] = ''
else:
page_data['super-disabled'] = 'disabled'
for file in os.listdir(os.path.join(helper.root_dir, 'app', 'translations')):
for file in sorted(os.listdir(os.path.join(helper.root_dir, 'app', 'translations'))):
if file.endswith('.json'):
if file != str(page_data['languages'][0] + '.json'):
page_data['languages'].append(file.split('.')[0])
if file not in helper.get_setting('disabled_language_files'):
if file != str(page_data['languages'][0] + '.json'):
page_data['languages'].append(file.split('.')[0])
template = "panel/panel_edit_user.html"
@ -738,8 +739,9 @@ class PanelHandler(BaseHandler):
for file in sorted(os.listdir(os.path.join(helper.root_dir, 'app', 'translations'))):
if file.endswith('.json'):
if file != str(page_data['languages'][0] + '.json'):
page_data['languages'].append(file.split('.')[0])
if file not in helper.get_setting('disabled_language_files'):
if file != str(page_data['languages'][0] + '.json'):
page_data['languages'].append(file.split('.')[0])
if user_id is None:
self.redirect("/panel/error?error=Invalid User ID")

View File

@ -14,6 +14,7 @@
"virtual_terminal_lines": 70,
"max_log_lines": 700,
"max_audit_entries": 300,
"disabled_language_files": ["lol_EN.json", ""],
"keywords": ["help", "chunk"],
"allow_nsfw_profile_pictures": false
}