INNER CODE UNIT · Python
get_strings_xml_keys
f-droid/fdroidclient · tools/find-translations.py:10
def get_strings_xml_keys(root):
keys = set()
for e in root.findall('.//string'):
if e.text is None:
continue
keys.add(e.attrib['name'])
return keys
android_dir = os.path.join(os.path.dirname(__file__),'../../../android.googlesource.com')
fdroidclient_dir = os.path.join(os.path.dirname(__file__), '..')
res_glob = 'res/values-[a-z][a-z]*/strings.xml'
locale_pat = re.compile(r'.*values-([a-z][a-z][a-zA-Z-]*)/strings.xml')
translation_pat = re.compile(r'.*name="([a-zA-Z0-9_]+)"[^>]*>"?([^"<]*).*')
keymap = {