mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 00:39:37 -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
|
||||
|
||||
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')]
|
||||
|
||||
lang_code = args.lang_code
|
||||
@ -64,10 +64,10 @@ def main():
|
||||
for line in fileinput.input(pysrc, openhook=fileinput.hook_encoded('utf-8')):
|
||||
# search `strings._('translate_key')`
|
||||
# `strings._('translate_key', True)`
|
||||
m = re.search(r'strings\._\((.*?)\)', line)
|
||||
m = re.findall(r'strings\._\((.*?)\)', line)
|
||||
if m:
|
||||
arg = m.group(1)
|
||||
key = arg.split(',')[0].strip('''"' ''')
|
||||
for match in m:
|
||||
key = match.split(',')[0].strip('''"' ''')
|
||||
translate_keys.add(key)
|
||||
|
||||
if args.show_all_keys:
|
||||
|
Loading…
Reference in New Issue
Block a user