-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github action to retrieve translations from weblate
This action clones weblate repository, retrieves fresh translations from it and commits the changes.
- Loading branch information
Showing
1 changed file
with
38 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,38 @@ | ||
name: Retrieve *.po files from weblate repository | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Clone weblate repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.repository }}-l10n | ||
path: .l10n | ||
|
||
- name: Copy *.po files from weblate repository | ||
shell: bash | ||
run: | | ||
pushd .l10n | ||
for component in $(find . -mindepth 1 -maxdepth 1 -type d -not -path './.*'); do | ||
source_path="" | ||
if [ -f "${component}/PATH" ]; then | ||
read -r source_path < "${component}/PATH" | ||
for po in "${component}"/*.po; do | ||
if [ -f "$po" ]; then | ||
cp "${po}" "../${source_path}/" | ||
fi | ||
done | ||
git -C .. add "${source_path}" | ||
fi | ||
done | ||
popd | ||
- name: Cleanup the weblate repository | ||
shell: bash | ||
run: | | ||
rm -rf .l10n | ||
- name: Commit *.po files | ||
shell: bash | ||
run: | | ||
git -c user.name='GitHub Workflow' -c user.email='[email protected]' commit -m "Update translations from weblate" |