Validator
The Transloco Validator package helps ensure the integrity of your translation files by validating their JSON structure and detecting duplicate keys. This tool is handy for maintaining consistent and error-free translation files throughout your project.
Installation
Usage
To ensure your translation files are always valid, configure Transloco Validator to run on specific paths during pre-commit checks. You can easily set this up in your lint-staged
configuration.
lint-staged
supports multiple configuration formats. All you need to do is add the following line to the configuration of your choice:
This ensures that any changes to your translation files are validated before they are committed.
Benefits
JSON Validation: Verifies that all translation files have a valid JSON structure.
Duplicate Key Detection: Ensures no duplicate keys are present in your translation files.
By incorporating Transloco Validator into your workflow, you can maintain high-quality translation files and avoid runtime issues caused by invalid JSON or key conflicts.
Last updated