Android native module to enable the usage of the FBT translation framework in React Native apps
$ yarn add fbt-rn-android-native --dev
$ react-native link fbt-rn-android-native
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.reactlibrary.FbtAndroidNativeModulePackage;
to the imports at the top of the file - Add
new FbtAndroidNativeModulePackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':fbt-rn-android-native' project(':fbt-rn-android-native').projectDir = new File(rootProject.projectDir, '../node_modules/fbt-rn-android-native/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':fbt-rn-android-native')
- The only currently supported way for changing the app language is by changing the language on the device itself. This native library depends on how the Android OS selects files depending on the language of the device.