From 34f7ed7151422cdadc732ed83f64f0f98775ffdf Mon Sep 17 00:00:00 2001 From: Siarhei Date: Sun, 14 Jan 2024 14:55:26 +0400 Subject: [PATCH 1/3] ci: localizations validation --- .github/workflows/validate.yml | 13 +++++++++++++ validate.sh | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..77caa2e --- /dev/null +++ b/.github/workflows/validate.yml @@ -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 diff --git a/validate.sh b/validate.sh index 79e1451..ff49ede 100755 --- a/validate.sh +++ b/validate.sh @@ -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 @@ -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) From 0aea00924d5c9b08e94ecb34cc9baa4fb7c5e4e5 Mon Sep 17 00:00:00 2001 From: Siarhei Date: Sun, 14 Jan 2024 14:57:13 +0400 Subject: [PATCH 2/3] ci: error in localization test --- ru.lproj/Localizable.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru.lproj/Localizable.strings b/ru.lproj/Localizable.strings index a02afed..fd7a39a 100644 --- a/ru.lproj/Localizable.strings +++ b/ru.lproj/Localizable.strings @@ -3,7 +3,7 @@ "auth.sign-in" = "Войти"; "auth.signOut" = "Выйти"; -"tabBar.sources" = "Источники"; +"tabBar.sources" = "Источники" "tabBar.favorites" = "Избранное"; "tabBar.add-source" = "Добавить источник"; "tabBar.settings" = "Настройки"; From d515a5a7e7dc7596a0e2518274527268d0653ac2 Mon Sep 17 00:00:00 2001 From: Siarhei Date: Sun, 14 Jan 2024 14:58:04 +0400 Subject: [PATCH 3/3] ci: test error revert --- ru.lproj/Localizable.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ru.lproj/Localizable.strings b/ru.lproj/Localizable.strings index fd7a39a..a02afed 100644 --- a/ru.lproj/Localizable.strings +++ b/ru.lproj/Localizable.strings @@ -3,7 +3,7 @@ "auth.sign-in" = "Войти"; "auth.signOut" = "Выйти"; -"tabBar.sources" = "Источники" +"tabBar.sources" = "Источники"; "tabBar.favorites" = "Избранное"; "tabBar.add-source" = "Добавить источник"; "tabBar.settings" = "Настройки";