.claude/skills/i18n-patterns/SKILL.md
Internationalization and translation patterns in LivestockAI
npx skillsauth add captjay98/gemini-livestockai i18n PatternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
LivestockAI supports multiple languages using i18next.
The i18n config is in app/lib/i18n/:
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
i18n.use(initReactI18next).init({
lng: 'en',
fallbackLng: 'en',
interpolation: {
escapeValue: false,
},
})
import { useTranslation } from 'react-i18next'
function MyComponent() {
const { t } = useTranslation()
return (
<div>
<h1>{t('dashboard.title')}</h1>
<p>{t('dashboard.welcome', { name: user.name })}</p>
</div>
)
}
| Code | Language | Status | | ---- | ---------- | ----------- | | en | English | Complete | | fr | French | Complete | | es | Spanish | Complete | | pt | Portuguese | Complete | | sw | Swahili | Complete | | ha | Hausa | In progress | | ar | Arabic | Planned |
Translations are in app/lib/i18n/locales/:
locales/
├── en.json
├── fr.json
├── es.json
├── pt.json
├── sw.json
└── ha.json
{
"common": {
"save": "Save",
"cancel": "Cancel",
"delete": "Delete"
},
"dashboard": {
"title": "Dashboard",
"welcome": "Welcome, {{name}}"
},
"batches": {
"title": "Batches",
"create": "Create Batch"
}
}
// Translation file
{
"birds": "{{count}} bird",
"birds_plural": "{{count}} birds"
}
// Usage
t('birds', { count: 1 }) // "1 bird"
t('birds', { count: 5 }) // "5 birds"
Use user settings for locale-aware formatting:
import { useFormatDate, useFormatNumber } from '~/features/settings'
function MyComponent() {
const formatDate = useFormatDate()
const formatNumber = useFormatNumber()
return (
<div>
<span>{formatDate(new Date())}</span>
<span>{formatNumber(1234.56)}</span>
</div>
)
}
multi-currency - Currency formattingrugged-utility - UI design principlesdata-ai
Input validation patterns with Zod in LivestockAI server functions
testing
Unit testing patterns with Vitest in LivestockAI
tools
Server → Service → Repository pattern for feature organization
data-ai
Server-side rendering and server functions with TanStack Start in LivestockAI