Internationalization
Multi-language support for web and mobile
Internationalization (i18n)
Multi-language support with automatic device detection.
Supported Languages
- English (en) - default
- Turkish (tr)
- Arabic (ar) - RTL support
Package
@repo/i18n
handles everything automatically.
Usage
import { useI18n } from '@repo/i18n';
function MyComponent() {
const { t, locale, isRTL } = useI18n();
return (
<View style={{ direction: isRTL ? 'rtl' : 'ltr' }}>
<Text>{t('common.hello')}</Text>
<Text>Current: {locale}</Text>
</View>
);
}
How It Works
- Checks device language
- Falls back to English if not supported
- Saves user preference
- Handles RTL automatically
Adding Languages
- Add to
packages/config/index.ts
- Create translation file in
packages/i18n/translations/
Done!