You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Android Translations
v1.0.0
A GitHub Action to find the missing translations for existing locales in an Android Project.
This action is the same as running the following but with a few exceptions
- Reports can be generated in JSON. Lint tool generates XML or HTML
- Seamless integration with GitHub actions to ease the use of generated data
- It's not easy to run the standalone lint tool on a Gradle project
${ANDROID_HOME}/tools/bin/lint --check MissingTranslation ${PROJECT_DIR}
- Almost zero config
- Generate reports in Markdown or JSON format
- Usable in other CI environments
The following workflow covers one possible use-case for this action. It uses the action to find the missing translations and generate a report in Markdown format. In the next step, it creates a comment on issue #1 with the generated report as its body.
on: [push]
jobs:
check-translations:
name: Check Translations
# Linux is required since this is a docker container action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: missing_translations
uses: ashutoshgngwr/android-missing-translations@v1
with:
projectDir: ./
- name: Add comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: 1
body: ${{ steps.missing_translations.outputs.report }}
The action can accept the following input parameters
Key | Description | Default Value |
---|---|---|
projectDir |
Android Project's root directory | . |
outputFormat |
Must be one of json or markdown |
markdown |
markdownTitle |
Title for the Markdown content (not used with JSON) | Missing Translations |
The action produces the following output which can be used in the next steps
or jobs. See steps
context
and needs
context.
In addition to this, the action also prints the same output to stdout
.
Key | Description |
---|---|
report |
The missing translations report for strings in the requested format. |
The following structure is used while generating JSON reports.
[
{
"name": "example",
"value": "This is an example",
"missing_locales": [
"hi",
"ru-RU"
]
},
"...more of the same stuff..."
]
docker run --rm --workdir /app --mount type=bind,source="$(pwd)",target=/app \
ashutoshgngwr/android-missing-translations:v1 --output-format=json