Pull translations from Transifex #265
This file contains hidden or 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: "main" | |
| - 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 "OpenCloud Action Extension/InfoPlist.xcstrings" | |
| beautifyJSON "OpenCloud File Provider/Localizable.xcstrings" | |
| beautifyJSON "OpenCloud Share Extension/InfoPlist.xcstrings" | |
| beautifyJSON "OpenCloud/Resources/InfoPlist.xcstrings" | |
| beautifyJSON "OpenCloud/Resources/Localizable.xcstrings" | |
| beautifyJSON "OpenCloudAppFramework/Resources/Localizable.xcstrings" | |
| - name: Setup Swift | |
| uses: swift-actions/setup-swift@v2.1.0 | |
| - name: Build ocstringstool | |
| run: | | |
| swift -v | |
| swiftc tools/normalizestrings/main.swift -o /tmp/ocstringstool | |
| - name: Run ocstringstool | |
| run: /tmp/ocstringstool normalize "OpenCloud/Resources" "OpenCloud Action Extension" "OpenCloud File Provider" "OpenCloud Share Extension" "OpenCloudAppFramework/Resources" | |
| - uses: GuillaumeFalourd/git-commit-push@v1.3 | |
| with: | |
| email: devops@opencloud.eu | |
| name: OpenClouders | |
| commit_message: "[tx] updated translations from transifex" |