0.0.6 • Published 3 months ago
react-i18next-validator v0.0.6
About The Project
Stop cluttering translation.json files with keys that are no longer used or duplicate values. Make sure you don't forget to add a key to the translation file when you add it to the code. Make sure you don't forget to remove a key from the translation file when you remove it from the code.
Getting Started
Installation
- Install NPM package
npm install react-i18next-validator
- Create config file in root directory
ri18next-v.config.json
{
"directory": "./public/locales/", // path to translation locales directory
"src": "./src/" // path to source code directory
}
- Add script to
package.json
"scripts": {
"ri18next-v": "ri18next-validator"
}
- Run script
npm run ri18next-v
- You can add additional options to the config
{
"errorLevel": "error", // error, warn, info
"regex": [], // string[] array of regex to look for in code files to match translation keys
"ignoreKeys": [] // string[] array of keys to ignore
}
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt
for more information.