Locale customization

Steps to Support a new language

  • Under locales folder, localization of a particular language JSON file has to be added.

  • Language JSON has to be imported in i18n.ts and load the resources to i18next as follows. import fil from './locales/fil.json'; const resources = { en, fil, ar, hi, kn, ta };

  • To ensure the language needs to be included in the const SUPPORTED_LANGUAGES. const { t } = useTranslation('common');

  • To use with react, must include the key with the 't' function <Text>{t('editLabel')}</Text>

About libraries

  • Inji Mobile has the capability to support multiple languages.

  • i18next is an internationalization framework. It provides the standard i18n features such as plurals, context, interpolation, and format. It provides a complete solution to localize products from the web to mobile and desktop.

  • react-i18next is a set of components, hooks, and plugins that sit on top of i18next, and is specifically designed for React.

  • expo-localization allows you to localize the app, customizing the experience for specific regions, and languages. It also provides access to the locale data on the native device.

Last updated

Copyright © 2021 MOSIP. This work is licensed under a Creative Commons Attribution (CC-BY-4.0) International License unless otherwise noted.