Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to find missing strings in only some locales #2356

Merged
merged 2 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/frontend-development/find-missing-locales.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from collections import defaultdict
from glob import glob
from json import load
Expand Down Expand Up @@ -46,9 +47,10 @@ def main():
for en_file in glob(path.join(DIR, EN_PATH)):
for file in glob(path.join(DIR, ALL_PATH)):
if path.basename(en_file) == path.basename(file) and file != en_file:
file_info = audit(file, en_file)
lang = path.basename(path.dirname(file))
per_language_dict[lang].append(file_info)
if len(sys.argv) == 0 or lang in sys.argv:
file_info = audit(file, en_file)
per_language_dict[lang].append(file_info)
for results in per_language_dict.values():
list(map(lambda args: print_result(*args), results))
print()
Expand Down
5 changes: 5 additions & 0 deletions website/docs/add_edit_translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ When editing existing translations, follow these rules:
A script can be used to find missing and potentially untranslated locale files. Run the script from the root dir using
`python scripts/frontend-development/find-missing-locales.py`.

You may pass any languages you want to include in the search to the script like so:\
`python scripts/frontend-development/find-missing-locales.py de ja`\
This would only show missing/untranslated strings in the German (de) and Japanese (ja) locale files.\
Passing nothing will default to searching all locales instead.

If you have any questions or need further assistance, please reach out.