Localization in React Native App with 3rd party Native Libraries

(Raj Suvariya) #1

We are developing a React Native app which has several third-party libraries. One of the libraries provides customization on Text by making strings public into out strings.xml in Android. Now the issue is that we have localization in RN using i18 which works fine for JS code but we need to have localization in the third party library as well.

Now as per Android we need to have two separate strings.xml files one for each language which we have created that already. Also, we need to update the resource with the new locale, which is not possible for the running activity, we need to recreate the activity. But the entire RN app runs on only one activity so we can’t just recreate it.

So the question is if we have the localization screen in JS then how to update the native android resources as well so that the third-party libraries also have the same language as RN app.