added find strings to translate in file

This commit is contained in:
bacon
2023-08-25 21:27:28 +03:00
parent 20941a1e37
commit 99a48fdc4c
9 changed files with 95 additions and 1 deletions

23
main.py Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/pyhton3
from lib.translate import translate
def parsing_file(f):
with open(f) as _f:
_cached = _f.read()
_list = _cached.split('\n')
_to_translate = []
_list = [i for i in _list if i != '']
for _str in _list:
if _str.find('%_t') != -1 or _str.find('%_T') != -1:
_to_translate.append(_str)
return _to_translate
trans_list = parsing_file('weapongenerator.lua')
print(trans_list)