0.4.0 • Published 7 months ago

@react-native-ml-kit/translate-text v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@react-native-ml-kit/translate-text

React Native On-Device Text Translation w/ Google ML Kit

⚠ WARNING: Don't use this in production.
This package is still in alpha release, so it's not recommended to use it in production until it's fully stable, however using it for testing purposes is helpful.

Getting started

npm install @react-native-ml-kit/translate-text --save

Linking

React Native > 0.59

CLI autolink feature links the module while building the app.

React Native <= 0.59

react-native link @react-native-ml-kit/translate-text

Installing Pods

On iOS, use CocoaPods to add the native RNMLKitTranslateText to your project:

npx pod-install

Usage

import TranslateText, {
  TranslateLanguage,
} from '@react-native-ml-kit/translate-text';

const translatedText = await TranslateText.translate({
  text: 'مرحبا بالعالم',
  sourceLanguage: TranslateLanguage.ARABIC,
  targetLanguage: TranslateLanguage.ENGLISH,
  downloadModelIfNeeded: true,
});
0.3.0

8 months ago

0.4.0

7 months ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago