AI Agent Integration
For AI agents working with translations, use the CLI commands instead of reading/writing files directly to ensure data integrity and proper validation.
Prompt for AI Agents:
When working with i18n translations, ALWAYS use the CLI commands instead of reading or modifying locale files directly. This ensures proper validation, formatting, and prevents corruption.
Available commands for translation management:
- Show help:
npx vibei18n --help
- Get translation:
npx vibei18n get <locale> <key>
- Set translation:
npx vibei18n set <locale> <key> <value>
- Check if exists:
npx vibei18n has <locale> <key>
- Get all locales for key:
npx vibei18n getAll <key>
- Find missing:
npx vibei18n missing <key>
- Check completeness:
npx vibei18n check --detailed
- Show statistics:
npx vibei18n stats
- List locales:
npx vibei18n locales
- Find hardcoded strings:
npx vibei18n hardcode-check --verbose
Example workflow:
- Check current state:
npx vibei18n stats
- Get specific translation:
npx vibei18n get en-US common.loading
- Update translation:
npx vibei18n set zh-hans common.loading "加载中..."
- Verify change:
npx vibei18n get zh-hans common.loading