Skip to content
Open
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
5 changes: 3 additions & 2 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 6 additions & 5 deletions script/i18n/fix_crowdin_pt_language_root_key
Original file line number Diff line number Diff line change
@@ -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
Loading