Skip to content

Commit

Permalink
Merge pull request #2 from superkeka/main
Browse files Browse the repository at this point in the history
ci: validation
  • Loading branch information
nikolaykargin authored Jan 14, 2024
2 parents 76eef02 + d515a5a commit a9b6ebd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Validate Localizations

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run validate.sh
run: ./validate.sh
5 changes: 5 additions & 0 deletions validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ current_directory = os.getcwd()
find_strings_files(current_directory)

all_keys = set.union(*language_keys.values())
errors = False

for language, keys in language_keys.items():
missing_keys = all_keys - keys
Expand All @@ -45,8 +46,12 @@ for language, keys in language_keys.items():
print(f"Missing keys in '{language}' localization:")
for key in missing_keys:
print(f" - {key}")
errors = True

if extra_keys:
print(f"Extra keys in '{language}' localization:")
for key in extra_keys:
print(f" - {key}")
errors = True

exit(errors)

0 comments on commit a9b6ebd

Please sign in to comment.