added find strings to translate in file

This commit is contained in:
bacon
2023-08-26 02:22:45 +03:00
parent 99a48fdc4c
commit e28a80454d
5 changed files with 39 additions and 17 deletions

23
main.py
View File

@@ -1,8 +1,22 @@
#!/usr/bin/pyhton3
import os
from lib.translate import translate
name = "weapongenerator.lua"
def _lister(path) -> list:
_list: list = []
try:
for f in os.walk(path):
_list.extend(f)
break
return sorted(_list[2])
except TypeError:
pass
def parsing_file(f):
with open(f) as _f:
_cached = _f.read()
@@ -18,6 +32,11 @@ def parsing_file(f):
return _to_translate
trans_list = parsing_file('weapongenerator.lua')
print(trans_list)
test_en = parsing_file(name)[0].split('\"')[1].split(' /*')[0]
test = translate(test_en)
print("msgid: \"%s\"" % test_en)
print("msgstr: \"%s\"" % test)
def all_to_translate():
pass