Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
globe

GitHub Action

Android Auto Translate

v0.6 Pre-release

Android Auto Translate

globe

Android Auto Translate

Auto Translate Android's strings.xml

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Android Auto Translate

uses: ashishb/[email protected]

Learn more about this action in ashishb/android-auto-translate

Choose a version

android-auto-translate

Lint YAML Lint Markdown Lint Dockerfiles Lint Python Code

Build Docker image

This GitHub Action auto-translates Android's strings.xml and fills in the missing translations in all other languages.

To use this for a new language, say "es", first create "values-es/strings.xml" file with the following placeholder content

<resources>
</resources>

and save the following to .github/workflows/translate-android.yaml in the repository.

---
name: Automatically Translate Android App

on:  # yamllint disable-line rule:truthy
  pull_request:
    branches: ["master", "main"]
    paths:
      - "**/strings.xml"

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:

  # Run locally with "act -j translateAndroid"
  translateAndroid:

    runs-on: ubuntu-latest
    timeout-minutes: 15

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3

      - name: Translate strings.xml to supported languages
        uses: ashishb/[email protected]

      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Add automatically generated translations
          commit_user_name: "ashishb's Translation Bot"