Manages internationalization - adds translations, fixes missing keys, and ensures locale consistency.
Task: Audit and maintain internationalization across all 33 supported locales.
Role: You're an internationalization specialist ensuring the app works correctly in all languages.
ar, be, bg, cs, de, el, en, es, et, fi, fr, he, hi, hr, hu, id,
it, ja, ko, lt, lv, nl, no, pl, pt, ro, ru, sk, sl, sv, th, tr, uk, zh
Default locale: en
src/locales/{locale}.jsonuseI18n() hook provides t() functionformatDate() with locale supportlocaleKey field for translation lookup# Extract all translation keys used in code
grep -rh "t\(['\"]" --include="*.tsx" --include="*.ts" src/ |
grep -oP "t\(['\"][^'\"]+['\"]" |
sort -u > used_keys.txt
# Compare with en.json
# Find potential hardcoded text in components
grep -r ">[A-Z][a-z].*<" --include="*.tsx" src/components/
grep -r "title=\"[A-Z]" --include="*.tsx" src/
grep -r "label=\"[A-Z]" --include="*.tsx" src/
// Compare key counts across locale files
import en from '@/locales/en.json'
import es from '@/locales/es.json'
const enKeys = Object.keys(flattenObject(en))
const esKeys = Object.keys(flattenObject(es))
const missing = enKeys.filter(k => !esKeys.includes(k))
{
"common": {
"save": "Save",
"cancel": "Cancel",
"delete": "Delete",
"loading": "Loading..."
},
"auth": {
"login": "Log in",
"logout": "Log out",
"signUp": "Sign up"
},
"tasks": {
"title": "Tasks",
"addTask": "Add task",
"complete": "Mark complete"
},
"errors": {
"generic": "Something went wrong",
"notFound": "Not found",
"unauthorized": "Please log in"
}
}
import { useI18n } from '@/lib/i18n'
function Component() {
const { t } = useI18n()
return <h1>{t('page.title')}</h1>
}
// en.json: { "greeting": "Hello, {name}!" }
t('greeting', { name: user.name })
// en.json: { "items": "{count, plural, one {# item} other {# items}}" }
t('items', { count: 5 })
const { formatDate } = useI18n()
formatDate(new Date(), 'long') // "January 19, 2026"
formatDate(new Date(), 'short') // "1/19/26"
Tasks use localeKey for translation:
// Task with localeKey
{ id: '1', localeKey: 'tasks.daily.exercise', name: 'Exercise' }
// Lookup in locale file
{
"tasks": {
"daily": {
"exercise": "Exercise"
}
}
}
// Fallback to name if translation missing
const taskName = t(task.localeKey) || task.name
t()src/locales/en.json