-
-
Notifications
You must be signed in to change notification settings - Fork 314
Collapse file tree
Files
Search this repository
/
Copy pathutils.js
More file actions
More file actions
Latest commit
46 lines (41 loc) · 1.05 KB
/
utils.js
File metadata and controls
46 lines (41 loc) · 1.05 KB
You must be signed in to make or propose changes
More edit options
Edit and raw actions
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
const // Versions
V1 = 'v1',
V2 = 'v2',
SUPPORTED_VERSIONS = new Set([
V1,
V2
]),
SUPPORTED_LANGUAGES = new Set([
'hi', // Hindi
'en', // English (US)
'en-uk', // English (UK)
'es', // Spanish
'fr', // French
'ja', // Japanese
'cs', // Czech
'nl', // Dutch
'sk', // Slovak
'ru', // Russian
'de', // German
'it', // Italian
'ko', // Korean
'pt-BR', // Brazilian Portuguese
'ar', // Arabic
'tr' // Turkish
]);
module.exports = {
logEvent (word, language, message, additionalInfo = {}) {
console.log({
'Word': word,
'Language': language,
'Message': message,
'AdditionalInfo': JSON.stringify(additionalInfo)
});
},
isLanguageSupported (language) {
return SUPPORTED_LANGUAGES.has(language);
},
isVersionSupported (version) {
return SUPPORTED_VERSIONS.has(version);
}
}