Skip to content

Commit

Permalink
Fix find-missing-locales.py (#1559)
Browse files Browse the repository at this point in the history
When the key of a dict in a locale file is missing, it gave an exception
instead of logging the problem with the translation.
  • Loading branch information
GuilleHoardings committed Feb 20, 2023
1 parent c4bcd2a commit ef2d67c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/frontend-development/find-missing-locales.py
Expand Up @@ -14,7 +14,11 @@ def get_not_translated(en_json, translation_json, parent_key=None):
if key in translation_json and translation_json[key] == en_json[key]:
not_translated.append(("{0}.{1}".format(parent_key, key) if parent_key else key))
elif isinstance(en_json[key], dict):
not_translated.extend(get_not_translated(en_json[key], translation_json[key], key))
if key not in translation_json:
msg = f"{parent_key}.{key} (and children)" if parent_key else "{key} (and children)"
not_translated.append(msg)
else:
not_translated.extend(get_not_translated(en_json[key], translation_json[key], key))
return not_translated


Expand Down

0 comments on commit ef2d67c

Please sign in to comment.