0.0.2 • Published 4 years ago
fbt-rn-android-native v0.0.2
fbt-rn-android-native
Android native module to enable the usage of the FBT translation framework in React Native apps
Getting started
$ yarn add fbt-rn-android-native --dev
Mostly automatic installation
$ react-native link fbt-rn-android-native
Manual installation
Android
- 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')
Usage
Notes
- 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.