Skip to content
check-circle

GitHub Action

i18next resources validator

v0.1.2 Latest version

i18next resources validator

check-circle

i18next resources validator

Validates localization resources for projects using i18next

Installation

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

              

- name: i18next resources validator

uses: matheusjardimb/i18next-resources-validator-action@v0.1.2

Learn more about this action in matheusjardimb/i18next-resources-validator-action

Choose a version

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.