0.0.2 • Published 4 years ago

fbt-rn-android-native v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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

  1. 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 the getPackages() method
  1. 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')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':fbt-rn-android-native')

Usage

React Native Demo App

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.