forked from a7medev/react-native-ml-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
82 lines (78 loc) · 1.62 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { NativeModules } from 'react-native';
const LINKING_ERROR =
`The package '@react-native-ml-kit/translate-text' doesn't seem to be linked. Make sure: \n\n` +
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
'- You rebuilt the app after installing the package\n' +
'- You are not using Expo managed workflow\n';
export const TranslateLanguage = Object.freeze({
AFRIKAANS: 'af',
ALBANIAN: 'sq',
ARABIC: 'ar',
BELARUSIAN: 'be',
BULGARIAN: 'bg',
BENGALI: 'bn',
CATALAN: 'ca',
CHINESE: 'zh',
CROATIAN: 'hr',
CZECH: 'cs',
DANISH: 'da',
DUTCH: 'nl',
ENGLISH: 'en',
ESPERANTO: 'eo',
ESTONIAN: 'et',
FINNISH: 'fi',
FRENCH: 'fr',
GALICIAN: 'gl',
GEORGIAN: 'ka',
GERMAN: 'de',
GREEK: 'el',
GUJARATI: 'gu',
HAITIAN_CREOLE: 'ht',
HEBREW: 'he',
HINDI: 'hi',
HUNGARIAN: 'hu',
ICELANDIC: 'is',
INDONESIAN: 'id',
IRISH: 'ga',
ITALIAN: 'it',
JAPANESE: 'ja',
KANNADA: 'kn',
KOREAN: 'ko',
LITHUANIAN: 'lt',
LATVIAN: 'lv',
MACEDONIAN: 'mk',
MARATHI: 'mr',
MALAY: 'ms',
MALTESE: 'mt',
NORWEGIAN: 'no',
PERSIAN: 'fa',
POLISH: 'pl',
PORTUGUESE: 'pt',
ROMANIAN: 'ro',
RUSSIAN: 'ru',
SLOVAK: 'sk',
SLOVENIAN: 'sl',
SPANISH: 'es',
SWEDISH: 'sv',
SWAHILI: 'sw',
TAGALOG: 'tl',
TAMIL: 'ta',
TELUGU: 'te',
THAI: 'th',
TURKISH: 'tr',
UKRAINIAN: 'uk',
URDU: 'ur',
VIETNAMESE: 'vi',
WELSH: 'cy',
});
const TranslateText = NativeModules.TranslateText
? NativeModules.TranslateText
: new Proxy(
{},
{
get() {
throw new Error(LINKING_ERROR);
},
}
);
export default TranslateText;