mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-28 07:17:15 -05:00
Fix check_lacked_trans.py script to check subfolders and also match on more than first occurrence of strings._ in a single line
This commit is contained in:
parent
e343aa194e
commit
5442beba8b
@ -54,7 +54,7 @@ def main():
|
|||||||
|
|
||||||
dir = args.onionshare_dir
|
dir = args.onionshare_dir
|
||||||
|
|
||||||
src = files_in(dir, 'onionshare') + files_in(dir, 'onionshare_gui')
|
src = files_in(dir, 'onionshare') + files_in(dir, 'onionshare_gui') + files_in(dir, 'onionshare_gui/share_mode') + files_in(dir, 'onionshare_gui/receive_mode') + files_in(dir, 'install/scripts')
|
||||||
pysrc = [p for p in src if p.endswith('.py')]
|
pysrc = [p for p in src if p.endswith('.py')]
|
||||||
|
|
||||||
lang_code = args.lang_code
|
lang_code = args.lang_code
|
||||||
@ -64,11 +64,11 @@ def main():
|
|||||||
for line in fileinput.input(pysrc, openhook=fileinput.hook_encoded('utf-8')):
|
for line in fileinput.input(pysrc, openhook=fileinput.hook_encoded('utf-8')):
|
||||||
# search `strings._('translate_key')`
|
# search `strings._('translate_key')`
|
||||||
# `strings._('translate_key', True)`
|
# `strings._('translate_key', True)`
|
||||||
m = re.search(r'strings\._\((.*?)\)', line)
|
m = re.findall(r'strings\._\((.*?)\)', line)
|
||||||
if m:
|
if m:
|
||||||
arg = m.group(1)
|
for match in m:
|
||||||
key = arg.split(',')[0].strip('''"' ''')
|
key = match.split(',')[0].strip('''"' ''')
|
||||||
translate_keys.add(key)
|
translate_keys.add(key)
|
||||||
|
|
||||||
if args.show_all_keys:
|
if args.show_all_keys:
|
||||||
for k in sorted(translate_keys):
|
for k in sorted(translate_keys):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user