changed main
This commit is contained in:
10
main.py
10
main.py
@@ -64,9 +64,9 @@ def all_to_translate(_dir):
|
||||
if len(_strings) > 0:
|
||||
for _string in _strings:
|
||||
_list.append(_string)
|
||||
_title = f'# ========== {_file.split("WPE2")[1]} ==========\n'
|
||||
_title = f'# ========== {_file.split("weapon-project-extended")[1]} ==========\n'
|
||||
_str = _str + _title
|
||||
print(f'Generate translation file for {_file.split("WPE2")[1]}')
|
||||
print(f'Generate translation file for {_file.split("weapon-project-extended")[1]}')
|
||||
# print(_list)
|
||||
for _name in _list:
|
||||
_msgctxt = ''
|
||||
@@ -74,10 +74,12 @@ def all_to_translate(_dir):
|
||||
_msgctxt = f'msgctxt "{_name[0][1]}"\n'
|
||||
|
||||
_msgid = f'msgid "{_name[0][0]}"\n'
|
||||
_msgstr = f'msgstr "{translate(_name[0][0])}"\n'
|
||||
|
||||
_entity = f'#: {_file.split("weapon-project-extended")[1]}:\n{_msgctxt}{_msgid}msgstr ""\n\n'
|
||||
print(_msgstr)
|
||||
_entity = f'#: {_file.split("weapon-project-extended")[1]}:\n{_msgctxt}{_msgid}{_msgstr}\n'
|
||||
_str = _str + _entity
|
||||
with open('test.txt', 'w') as f:
|
||||
with open('data/localization/ru.po', 'w', encoding='utf8') as f:
|
||||
f.write(_str)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user