android-missing-translations

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

README

Android Missing Translations

Docker Docker image size

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

  1. Reports can be generated in JSON. Lint tool generates XML or HTML
  2. Seamless integration with GitHub actions to ease the use of generated data
  3. It's not easy to run the standalone lint tool on a Gradle project
${ANDROID_HOME}/tools/bin/lint --check MissingTranslation ${PROJECT_DIR}

Features

  • Almost zero config
  • Generate reports in Markdown or JSON format
  • Usable in other CI environments

Usage

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 }}
Input

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
Output

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.
JSON Report 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..."
]
Using Without GitHub Actions
docker run --rm --workdir /app --mount type=bind,source="$(pwd)",target=/app \
   ashutoshgngwr/android-missing-translations:v1 --output-format=json

License

Apache License 2.0

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL