Skip to content

i18next resources validator

Actions
Validates localization resources for projects using i18next
v0.1.2
Latest
Star (1)

i18next Resource Validator Action

GitHub Super-Linter CI release npm version

GitHub Action for validating i18next resources. Avoid issues with your translations.

This toll checks for:

  • Missing translations in all supported languages
  • Mal-formed or missing string params (WIP)
  • Sort your strings to reduce conflicts (WIP)

Usage

This tool only takes the path of the folder containing the .json files to be checked as a param.

GitHub actions

Create a file .github/workflows/i18n-validator.yml with:

name: Validate json files containing i18n strings

on: [ push ]

jobs:
  dependency_check_job:
    runs-on: ubuntu-latest
    name: Check for issues at i18n files
    steps:
      - uses: actions/checkout@v4
      - uses: matheusjardimb/i18next-resources-validator@latest
        with:
          # Assuming the .json files are located at '/i18n/' folder in your project 
          resources_path:
            ${{ github.workspace }}/i18n/
          # Optional param for disabling logs 
          quiet: 'false'

Gitlab

Add the following block to your .gitlab-ci.yml file:

validate_dependencies:
  image: node:20.5.0
  script:
    - export INPUT_RESOURCES_PATH="${CI_PROJECT_DIR}/i18n"
    - export INPUT_QUIET='true' # This line is optional
    - npx i18next-resources-validator@latest

NPX

Dependencies checker is also published into npm, so you can run with:

export INPUT_RESOURCES_PATH="${CI_PROJECT_DIR}/i18n"
export INPUT_QUIET='true' # This line is optional
npx i18next-resources-validator@latest

License

See more about the MIT licensing at LICENSE.

i18next resources validator is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Validates localization resources for projects using i18next
v0.1.2
Latest

i18next resources validator is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.