Update file main.py
This commit is contained in:
3
main.py
3
main.py
@@ -25,7 +25,6 @@ def open_translate(arg, lang='ru'):
|
|||||||
with open(translation_file, 'r') as f:
|
with open(translation_file, 'r') as f:
|
||||||
translation_text = f.read()
|
translation_text = f.read()
|
||||||
translation_json = translation_text.split('\n\n')
|
translation_json = translation_text.split('\n\n')
|
||||||
print(translation_json)
|
|
||||||
return translation_json
|
return translation_json
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +66,6 @@ def all_to_translate(_dir):
|
|||||||
_title = f'# ========== {_file.split("weapon-project-extended")[1]} ==========\n'
|
_title = f'# ========== {_file.split("weapon-project-extended")[1]} ==========\n'
|
||||||
_str = _str + _title
|
_str = _str + _title
|
||||||
print(f'Generate translation file for {_file.split("weapon-project-extended")[1]}')
|
print(f'Generate translation file for {_file.split("weapon-project-extended")[1]}')
|
||||||
# print(_list)
|
|
||||||
for _name in _list:
|
for _name in _list:
|
||||||
_msgctxt = ''
|
_msgctxt = ''
|
||||||
if len(_name[0][1]) > 1:
|
if len(_name[0][1]) > 1:
|
||||||
@@ -76,7 +74,6 @@ def all_to_translate(_dir):
|
|||||||
_msgid = f'msgid "{_name[0][0]}"\n'
|
_msgid = f'msgid "{_name[0][0]}"\n'
|
||||||
_msgstr = f'msgstr "{translate(_name[0][0])}"\n'
|
_msgstr = f'msgstr "{translate(_name[0][0])}"\n'
|
||||||
|
|
||||||
print(_msgstr)
|
|
||||||
_entity = f'#: {_file.split("weapon-project-extended")[1]}:\n{_msgctxt}{_msgid}{_msgstr}\n'
|
_entity = f'#: {_file.split("weapon-project-extended")[1]}:\n{_msgctxt}{_msgid}{_msgstr}\n'
|
||||||
_str = _str + _entity
|
_str = _str + _entity
|
||||||
with open('data/localization/ru.po', 'w', encoding='utf8') as f:
|
with open('data/localization/ru.po', 'w', encoding='utf8') as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user