added find strings to translate in file
This commit is contained in:
23
main.py
23
main.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user