Pull translations from Transifex #98
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
name: "Pull translations from Transifex" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 3 * * *" | |
jobs: | |
pull-translations: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.DEPLOYMENT_SSH_KEY }} | |
ref: "master" | |
- name: l10n-pull | |
uses: transifex/cli-action@v2 | |
with: | |
token: ${{ secrets.TX_TOKEN }} | |
args: pull --force --skip --all | |
- name: l10n-format | |
shell: bash | |
run: | | |
beautifyJSON() { | |
jq --sort-keys 'walk(if type == "object" then del(."th_TH", ."pt_PT", ."pt_BR", ."nn_NO", ."nb_NO", ."en_GB") else . end)' $1 >$1.tmp | |
mv $1.tmp $1 | |
} | |
beautifyJSON "ownCloudSDK/Resources/Localizable.xcstrings" | |
beautifyJSON "ownCloudUI/Resources/Localizable.xcstrings" | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y clang libpython2.7 libpython2.7-dev | |
- name: Download Swift | |
run: wget -o /tmp/swift.tar.gz https://download.swift.org/swift-6.0.2-release/ubuntu2004/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE-ubuntu20.04.tar.gz | |
- name: Extract Swift | |
run: tar xzf /tmp/swift.tar.gz | |
- name: Move Swift to /usr/share | |
run: sudo mv /tmp/swift /usr/share/swift | |
- name: Add Swift to PATH | |
run: echo "export PATH=/usr/share/swift/usr/bin:\$PATH" >> $GITHUB_ENV | |
- name: Verify Swift installation | |
run: swift -v | |
- name: Show Swift file | |
run: cat tools/ocstringstool/ocstringstool/main.swift | |
- name: Compile Swift file | |
run: swiftc tools/ocstringstool/ocstringstool/main.swift -o /tmp/ocstringstool | |
- name: Run compiled Swift program | |
run: /tmp/ocstringstool normalize "ownCloudSDK/Resources" "ownCloudUI/Resources" | |
- uses: GuillaumeFalourd/git-commit-push@v1.3 | |
with: | |
email: devops@owncloud.com | |
name: ownClouders | |
commit_message: "[tx] updated translations from transifex" |