Language
Felix Travel provides built-in multi-language (i18n) support designed for real-world applications. UI text is separated from logic and stored in dedicated language files, allowing developers to introduce new locales or update translations without modifying components or application flow.
Structure
Language files are stored in a dedicated folder and separated by locale.
/app/assets/localization/
├─ en.json
├─ fr.json
├─ es.json
Each file contains key–value pairs used across the application UI.
Change Default Language
Open the configuration file and update the default locale:
./app/configs/index.ts
export const Settings = {
..
defaultLanguage: 'en',
..
}
Add New Language
- Duplicate an existing language file (e.g.
en.json) - Rename it to your locale code (e.g.
es.json) - Translate values
- Register the language in the app config
./app/configs/index.ts
export const Settings = {
..
languageSupport: ['en', 'es', 'fr'],
..
}
RTL Support
RTL language support is built into the app architecture.
By setting the language code to ar or he, the application adjusts layout direction accordingly, enabling seamless support for Arabic and Hebrew with minimal additional setup.
./app/utils/index.js
export const isLanguageRTL = code => {
switch (code) {
case 'ar':
case 'he':
return true;
default:
return false;
}
};
export const reloadLocale = (oldLanguage, newLanguage) => {
const oldStyle = isLanguageRTL(oldLanguage);
const newStyle = isLanguageRTL(newLanguage);
if (oldStyle !== newStyle) {
I18nManager.forceRTL(newStyle);
RNRestart.Restart();
}
};