From be786755671012df9bea97c1826060b5723cfe7a Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 26 Mar 2026 16:48:10 +0100 Subject: [PATCH 1/2] less repetition in script fixing pt root keys --- script/i18n/fix_crowdin_pt_language_root_key | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/script/i18n/fix_crowdin_pt_language_root_key b/script/i18n/fix_crowdin_pt_language_root_key index 0237262f1427..0e381d79c42d 100755 --- a/script/i18n/fix_crowdin_pt_language_root_key +++ b/script/i18n/fix_crowdin_pt_language_root_key @@ -1,10 +1,11 @@ #!/usr/bin/env bash -echo "Fixing language root key in pt-BR and pt-PT crowdin files to match the filename" if [ "$(uname -s)" = "Darwin" ]; then - sed -i '' 's/^pt:/pt-BR:/' config/locales/crowdin/*pt-BR*.yml modules/*/config/locales/crowdin/*pt-BR*.yml - sed -i '' 's/^pt:/pt-PT:/' config/locales/crowdin/*pt-PT*.yml modules/*/config/locales/crowdin/*pt-PT*.yml + sed_inplace() { sed -i '' "$@"; } else - sed -i 's/^pt:/pt-BR:/' config/locales/crowdin/*pt-BR*.yml modules/*/config/locales/crowdin/*pt-BR*.yml - sed -i 's/^pt:/pt-PT:/' config/locales/crowdin/*pt-PT*.yml modules/*/config/locales/crowdin/*pt-PT*.yml + sed_inplace() { sed -i "$@"; } fi + +echo "Fixing language root key in pt-BR and pt-PT crowdin files to match the filename" +sed_inplace 's/^pt:/pt-BR:/' config/locales/crowdin/*pt-BR*.yml modules/*/config/locales/crowdin/*pt-BR*.yml +sed_inplace 's/^pt:/pt-PT:/' config/locales/crowdin/*pt-PT*.yml modules/*/config/locales/crowdin/*pt-PT*.yml From 6bdc6089b2eed91d932da0a1599fe6f1ddacc0f9 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 26 Mar 2026 16:40:43 +0100 Subject: [PATCH 2/2] rewrite translation files using psych before committing --- .github/workflows/crowdin.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 9e2e705dc91b..3f64cab297c8 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -83,8 +83,9 @@ jobs: run: | sudo chown -R $(id -u):$(id -g) config/locales/crowdin/ modules/*/config/locales/crowdin/ - name: "Fix root key in Portuguese crowdin translation files" - run: | - script/i18n/fix_crowdin_pt_language_root_key + run: script/i18n/fix_crowdin_pt_language_root_key + - name: "Rewrite crowdin translation files using ruby yaml library" + run: script/i18n/rewrite_crowdin_yml_files - name: "Commit translations" env: BRANCH: ${{ matrix.branch }}