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,8 +606,9 @@ 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 not in helper.get_setting('disabled_language_files'):
if file != str(page_data['languages'][0] + '.json'):
page_data['languages'].append(file.split('.')[0])
@ -738,6 +739,7 @@ class PanelHandler(BaseHandler):
for file in sorted(os.listdir(os.path.join(helper.root_dir, 'app', 'translations'))):
if file.endswith('.json'):
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])

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
}