Server IP : 184.154.167.98 / Your IP : 18.227.140.251 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/l.v.e-manager/utils/ |
Upload File : |
#!/opt/cloudlinux/venv/bin/python3 -bb # coding:utf-8 # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT from __future__ import print_function from __future__ import division from __future__ import absolute_import import json import os BASE_DIR = os.path.join(os.path.dirname(__file__), "../") I18N_SOURCE = BASE_DIR + 'commons/spa-resources/i18n/' en = json.load(open(I18N_SOURCE + 'en-en.json')) ru = json.load(open(I18N_SOURCE + 'ru-ru.json')) def parse(ru, en): """ Get value from en-EN.json. if not exist - get key from ru.json Save data to only_en.json :param ru: current position in ru.json :param en: current position in en-EN.json :return:None """ for k, v in ru.items(): if isinstance(v, dict): parse(v, en[k]) else: ru[k] = en.get(k, k) if __name__ == '__main__': parse(ru, en) json.dump(ru, open(I18N_SOURCE + 'translate_template.json', 'w'), indent=4)