skip en and unchanged
This commit is contained in:
parent
f964827f00
commit
3cd2892bdd
14
lang.py
14
lang.py
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import glob
|
||||
|
||||
@ -17,13 +18,14 @@ def main():
|
||||
cn = get_lang('cn')
|
||||
for fn in glob.glob('./src/lang/*'):
|
||||
lang = os.path.basename(fn)[:-3]
|
||||
if lang == 'cn': continue
|
||||
if lang in ['en', 'cn']: continue
|
||||
not_transated = (set(cn.keys()) - set(get_lang(lang).keys()))
|
||||
extra = '\n'.join(map(lambda x: ' ("%s", ""),'%x, not_transated))
|
||||
endstr = '].iter().cloned().collect();'
|
||||
text = open(fn).read().replace(endstr, extra + '\n' + endstr)
|
||||
with open(fn, 'wt') as fh:
|
||||
fh.write(text)
|
||||
if not_transated:
|
||||
extra = '\n'.join(map(lambda x: ' ("%s", ""),'%x, not_transated))
|
||||
endstr = '].iter().cloned().collect();'
|
||||
text = open(fn).read().replace(endstr, extra + '\n' + endstr)
|
||||
with open(fn, 'wt') as fh:
|
||||
fh.write(text)
|
||||
|
||||
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user