GitHub Action
i18next resources validator
v0.1.2
Latest 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)
This tool only takes the path of the folder containing the .json
files to be checked as a param.
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'
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
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
See more about the MIT licensing at LICENSE.