Internationalization Check
Target: $1 (or src/ if not specified)
- Detect i18n library:
cat package.json | grep -E '"i18next"|"react-intl"|"vue-i18n"|"@angular/localize"|"next-intl"'
ls src/locales/ src/i18n/ public/locales/ 2>/dev/null | head -10
- Find hardcoded user-visible strings (not variable names, not URLs):
grep -rn '"[A-Z][a-z ]\+"\|'"'"'[A-Z][a-z ]\+'"'" ${1:-src/} --include="*.tsx" --include="*.jsx" --include="*.vue" | grep -v "className\|import\|export\|test\|spec" | head -30
- For each hardcoded string:
- Is it user-visible? (skip internal error codes, class names)
- Generate a translation key:
page.section.description - Show the replacement code using the project's i18n function
- Update the locale file (
en.jsonor equivalent) with new keys.
- Replace hardcoded strings in source with i18n function calls.
- Report: N strings found, N replaced, N skipped (non-user-visible).