Installation
Glot is distributed as an npm package calledglotctl. The CLI command is glot.
Initialize Configuration
Create a.glotrc.json configuration file:
Run Your First Check
Check your project for all i18n issues:Understanding the Output
Glot displays issues in a familiar format:- The problematic text in quotes
- The issue type (e.g.,
hardcoded-text) - File path and location
- Source code context with a pointer
Existing Projects
If your project already has many hardcoded strings, use the baseline command to suppress existing warnings and start fresh:// glot-disable-next-line comments above each hardcoded text, so you can add glot to CI immediately and gradually fix existing issues over time.
Fixing Issues
Replace hardcoded text with translation function calls:messages/en.json
Add to package.json
For convenience, add glot commands to yourpackage.json:
Using with CI
Glot returns exit code 1 when errors are found. Warnings return exit 0 by default, or exit 1 when you pass--error-on-warnings, making glot ideal for CI pipelines. Add a step to your workflow:
Next Steps
Commands
Learn all available commands
Configuration
Customize glot for your project