A React Native mobile app demonstrating multilingual support using i18next and react-i18next.
The app allows users to switch between English and Spanish through a custom drawer navigation interface. It demonstrates language localization, React Navigation drawer setup, reusable screen structure, and clean mobile UI flow.
- Multi-language support
- English and Spanish translations
- Language switching through drawer navigation
- Custom drawer component
- React Navigation integration
- i18next and react-i18next setup
- Reusable screen structure
- Android and iOS support
- Clean React Native project architecture
- React Native
- JavaScript
- React Navigation
- Drawer Navigation
- Stack Navigation
- i18next
- react-i18next
- react-native-modal
- Android
- iOS
LanguageSelector/
├── assets/
│ └── images/
│ ├── UK.png
│ └── Spain.png
├── src/
│ ├── components/
│ │ ├── Common/
│ │ │ └── LanguageContext.js
│ │ └── LanguageModal/
│ ├── navigations/
│ │ ├── DrawerNavigation/
│ │ │ └── DrawerNavigation.js
│ │ └── StackNavigation/
│ │ └── StackNavigation.js
│ ├── screens/
│ │ ├── CustomDrawer/
│ │ ├── FirstScreen/
│ │ └── HomeScreen/
│ ├── translations/
│ │ ├── en.json
│ │ └── es.json
│ └── utils/
├── App.js
├── i18n.js
├── package.json
└── README.md| Language | Code |
|---|---|
| English | en |
| Spanish | es |
English:
{
"welcomeMessage": "Welcome to my app!",
"changeLang": "Change Language"
}Spanish:
{
"welcomeMessage": "¡Bienvenido a mi aplicación!",
"changeLang": "Cambiar idioma"
}Clone the repository:
git clone https://github.com/Shahzadali062/LanguageSelector.git
cd LanguageSelectorInstall dependencies:
npm installFor iOS, install pods:
cd ios
pod install
cd ..Start Metro:
npm startRun on Android:
npm run androidRun on iOS:
npm run ios- The app is wrapped with
I18nextProvider. - Translation files are loaded from
src/translations. - English is set as the default language.
- Drawer navigation shows English and Spanish options.
- When the user taps a language option,
i18n.changeLanguage()updates the app language. - Text values are rendered using the
useTranslation()hook.
The app uses i18n.changeLanguage() to switch language dynamically:
i18n.changeLanguage('en');
i18n.changeLanguage('es');Text is displayed using translation keys:
const { t } = useTranslation();
<Text>{t('welcomeMessage')}</Text>
<Text>{t('changeLang')}</Text>This project can be used as a starter template for:
- Multilingual React Native apps
- Language selector screens
- Drawer-based language switching
- Localization setup using i18next
- International mobile applications
- Reusable React Native UI demos
- Add Urdu, Arabic, Thai, and French language support
- Add persistent language selection with AsyncStorage
- Improve UI design for the language selector
- Add RTL layout support for Urdu/Arabic
- Add flag-based language cards
- Add onboarding screen for first-time language selection
- Convert project to TypeScript
- Add unit tests for translation keys
Shahzad Ali
React Native Developer | Mobile App Developer | AI Researcher
- GitHub: https://github.com/Shahzadali062
- LinkedIn: https://www.linkedin.com/in/shahzad-ali-989706251
- Location: Bangkok, Thailand
This project is for portfolio, learning, and demonstration purposes.