translations.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: Update translation widgets
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. languages:
  6. description: 'Languages to update translation widgets for.'
  7. required: true
  8. default: 'i18n/*.json'
  9. jobs:
  10. translations:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Load Repository
  14. uses: actions/checkout@v2
  15. with:
  16. token: ${{ secrets.WIKIBOT_TOKEN }}
  17. - name: Update Widgets
  18. run: |
  19. sudo apt update
  20. sudo apt-get install inkscape
  21. for language in ${{ github.event.inputs.languages }}
  22. do
  23. language=$(basename $language .json)
  24. if [[ "$language" =~ [^[:lower:]-] ]]
  25. then
  26. echo "$language" is not a translation
  27. else
  28. wget https://translate.wikibot.de/widgets/wiki-bot/$language/discord/svg-badge.svg
  29. convert -background none svg-badge.svg i18n/widgets/$language.png
  30. rm svg-badge.svg
  31. fi
  32. done
  33. - name: Commit changes
  34. uses: EndBug/add-and-commit@v9
  35. with:
  36. author_name: WikiBot-bot
  37. author_email: 69196528+WikiBot-bot@users.noreply.github.com
  38. committer_name: WikiBot-bot
  39. committer_email: 69196528+WikiBot-bot@users.noreply.github.com
  40. message: "Update translation widgets"
  41. add: "i18n/widgets/*.png"
  42. github_token: ${{ secrets.WIKIBOT_TOKEN }}