-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a translation merger workflow that fixes bad directory problem.
- Loading branch information
Luke Davis
authored and
Luke Davis
committed
Jul 26, 2024
1 parent
7bd7519
commit ba7e55e
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# https://crontab.guru/crontab.5.html | ||
|
||
name: Check for and merge l10n updates | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: '08 00 * * 6' # At 00:08 on Saturdays | ||
|
||
jobs: | ||
update-translations: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v3 | ||
- name: Merge changes | ||
run: | | ||
git config --global user.name translation-updater | ||
git config --global user.email [email protected] | ||
git pull | ||
git remote add l10n https://github.com/nvdaaddons/addonUpdater | ||
git fetch l10n | ||
git merge -q --ff -m "Translations automerge" l10n/stable | ||
- name: Fix problem directories | ||
run: | | ||
for badDir in $(find addon/locale -name '*add-ons'); do | ||
echo "Fixing bad directory: $badDir" | ||
mkdir "$badDir"/../LC_MESSAGES 2>/dev/null | ||
# Have to use real mv not git mv, because git mv won't overwrite | ||
mv "$badDir"/LC_MESSAGES/nvda.po "$badDir"/../LC_MESSAGES/ | ||
git add "$badDir"/../LC_MESSAGES/nvda.po | ||
rm -r "$badDir" | ||
done | ||
git commit -am 'Removing "add-ons" from l10n directories.' | ||
- name: Pushing updates | ||
run: | | ||
git push | ||