forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Strings.ts
498 lines (490 loc) · 15.8 KB
/
Strings.ts
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
export interface Strings {
title: string;
send: string;
unknownFile: string;
unknownCard: string;
receiptTax: string;
receiptVat: string;
receiptTotal: string;
messageRetry: string;
messageFailed: string;
messageSending: string;
timeSent: string;
consolePlaceholder: string;
listeningIndicator: string;
uploadFile: string;
speak: string;
}
interface LocalizedStrings {
[locale: string]: Strings;
}
const localizedStrings: LocalizedStrings = {
'en-us': {
title: 'Chat',
send: 'Send',
unknownFile: '[File of type \'%1\']',
unknownCard: '[Unknown Card \'%1\']',
receiptVat: 'VAT',
receiptTax: 'Tax',
receiptTotal: 'Total',
messageRetry: 'retry',
messageFailed: 'couldn\'t send',
messageSending: 'sending',
timeSent: ' at %1',
consolePlaceholder: 'Type your message...',
listeningIndicator: 'Listening...',
uploadFile: 'Upload file',
speak: 'Speak'
},
'ja-jp': {
title: 'チャット',
send: '送信',
unknownFile: '[ファイルタイプ \'%1\']',
unknownCard: '[不明なカード \'%1\']',
receiptVat: '消費税',
receiptTax: '税',
receiptTotal: '合計',
messageRetry: '再送',
messageFailed: '送信できませんでした。',
messageSending: '送信中',
timeSent: ' %1',
consolePlaceholder: 'メッセージを入力してください...',
listeningIndicator: '聴いてます...',
uploadFile: '',
speak: ''
},
'nb-no': {
title: 'Chat',
send: 'Send',
unknownFile: '[Fil av typen \'%1\']',
unknownCard: '[Ukjent Kort \'%1\']',
receiptVat: 'MVA',
receiptTax: 'Skatt',
receiptTotal: 'Totalt',
messageRetry: 'prøv igjen',
messageFailed: 'kunne ikke sende',
messageSending: 'sender',
timeSent: ' %1',
consolePlaceholder: 'Skriv inn melding...',
listeningIndicator: 'Lytter...',
uploadFile: 'Last opp fil',
speak: 'Snakk'
},
'da-dk': {
title: 'Chat',
send: 'Send',
unknownFile: '[Fil af typen \'%1\']',
unknownCard: '[Ukendt kort \'%1\']',
receiptVat: 'Moms',
receiptTax: 'Skat',
receiptTotal: 'Total',
messageRetry: 'prøv igen',
messageFailed: 'ikke sendt',
messageSending: 'sender',
timeSent: ' kl %1',
consolePlaceholder: 'Skriv din besked...',
listeningIndicator: 'Lytter...',
uploadFile: '',
speak: ''
},
'de-de': {
title: 'Chat',
send: 'Senden',
unknownFile: '[Datei vom Typ \'%1\']',
unknownCard: '[Unbekannte Card \'%1\']',
receiptVat: 'VAT',
receiptTax: 'MwSt.',
receiptTotal: 'Gesamtbetrag',
messageRetry: 'wiederholen',
messageFailed: 'konnte nicht senden',
messageSending: 'sendet',
timeSent: ' um %1',
consolePlaceholder: 'Verfasse eine Nachricht...',
listeningIndicator: 'Hören...',
uploadFile: '',
speak: ''
},
'pl-pl': {
title: 'Chat',
send: 'Wyślij',
unknownFile: '[Plik typu \'%1\']',
unknownCard: '[Nieznana karta \'%1\']',
receiptVat: 'VAT',
receiptTax: 'Podatek',
receiptTotal: 'Razem',
messageRetry: 'wyślij ponownie',
messageFailed: 'wysłanie nieudane',
messageSending: 'wysyłanie',
timeSent: ' o %1',
consolePlaceholder: 'Wpisz swoją wiadomość...',
listeningIndicator: 'Słuchanie...',
uploadFile: 'Wyślij plik',
speak: 'Mów'
},
'ru-ru': {
title: 'Чат',
send: 'Отправить',
unknownFile: '[Неизвестный тип \'%1\']',
unknownCard: '[Неизвестная карта \'%1\']',
receiptVat: 'VAT',
receiptTax: 'Налог',
receiptTotal: 'Итого',
messageRetry: 'повторить',
messageFailed: 'не удалось отправить',
messageSending: 'отправка',
timeSent: ' в %1',
consolePlaceholder: 'Введите ваше сообщение...',
listeningIndicator: 'прослушивание...',
uploadFile: '',
speak: ''
},
'nl-nl': {
title: 'Chat',
send: 'Verstuur',
unknownFile: '[Bestand van het type \'%1\']',
unknownCard: '[Onbekende kaart \'%1\']',
receiptVat: 'VAT',
receiptTax: 'BTW',
receiptTotal: 'Totaal',
messageRetry: 'opnieuw',
messageFailed: 'versturen mislukt',
messageSending: 'versturen',
timeSent: ' om %1',
consolePlaceholder: 'Typ je bericht...',
listeningIndicator: 'Aan het luisteren...',
uploadFile: 'Bestand uploaden',
speak: 'Spreek'
},
'lv-lv': {
title: 'Tērzēšana',
send: 'Sūtīt',
unknownFile: '[Nezināms tips \'%1\']',
unknownCard: '[Nezināma kartīte \'%1\']',
receiptVat: 'VAT',
receiptTax: 'Nodoklis',
receiptTotal: 'Kopsumma',
messageRetry: 'Mēģināt vēlreiz',
messageFailed: 'Neizdevās nosūtīt',
messageSending: 'Nosūtīšana',
timeSent: ' %1',
consolePlaceholder: 'Ierakstiet savu ziņu...',
listeningIndicator: 'Klausoties...',
uploadFile: '',
speak: ''
},
'pt-br': {
title: 'Bate-papo',
send: 'Enviar',
unknownFile: '[Arquivo do tipo \'%1\']',
unknownCard: '[Cartão desconhecido \'%1\']',
receiptVat: 'VAT',
receiptTax: 'Imposto',
receiptTotal: 'Total',
messageRetry: 'repetir',
messageFailed: 'não pude enviar',
messageSending: 'enviando',
timeSent: ' às %1',
consolePlaceholder: 'Digite sua mensagem...',
listeningIndicator: 'Ouvindo...',
uploadFile: 'Subir arquivo',
speak: 'Falar'
},
'fr-fr': {
title: 'Chat',
send: 'Envoyer',
unknownFile: '[Fichier de type \'%1\']',
unknownCard: '[Carte inconnue \'%1\']',
receiptVat: 'TVA',
receiptTax: 'Taxe',
receiptTotal: 'Total',
messageRetry: 'réessayer',
messageFailed: 'envoi impossible',
messageSending: 'envoi',
timeSent: ' à %1',
consolePlaceholder: 'Écrivez votre message...',
listeningIndicator: 'Écoute...',
uploadFile: '',
speak: ''
},
'es-es': {
title: 'Chat',
send: 'Enviar',
unknownFile: '[Archivo de tipo \'%1\']',
unknownCard: '[Tarjeta desconocida \'%1\']',
receiptVat: 'IVA',
receiptTax: 'Impuestos',
receiptTotal: 'Total',
messageRetry: 'reintentar',
messageFailed: 'no enviado',
messageSending: 'enviando',
timeSent: ' a las %1',
consolePlaceholder: 'Escribe tu mensaje...',
listeningIndicator: 'Escuchando...',
uploadFile: '',
speak: ''
},
'el-gr': {
title: 'Συνομιλία',
send: 'Αποστολή',
unknownFile: '[Αρχείο τύπου \'%1\']',
unknownCard: '[Αγνωστη Κάρτα \'%1\']',
receiptVat: 'VAT',
receiptTax: 'ΦΠΑ',
receiptTotal: 'Σύνολο',
messageRetry: 'δοκιμή',
messageFailed: 'αποτυχία',
messageSending: 'αποστολή',
timeSent: ' την %1',
consolePlaceholder: 'Πληκτρολόγηση μηνύματος...',
listeningIndicator: 'Ακούγοντας...',
uploadFile: '',
speak: ''
},
'it-it': {
title: 'Chat',
send: 'Invia',
unknownFile: '[File di tipo \'%1\']',
unknownCard: '[Card sconosciuta \'%1\']',
receiptVat: 'VAT',
receiptTax: 'Tasse',
receiptTotal: 'Totale',
messageRetry: 'riprova',
messageFailed: 'impossibile inviare',
messageSending: 'invio',
timeSent: ' %1',
consolePlaceholder: 'Scrivi il tuo messaggio...',
listeningIndicator: 'Ascoltando...',
uploadFile: '',
speak: ''
},
'zh-hans': {
title: '聊天',
send: '发送',
unknownFile: '[类型为\'%1\'的文件]',
unknownCard: '[未知的\'%1\'卡片]',
receiptVat: '消费税',
receiptTax: '税',
receiptTotal: '共计',
messageRetry: '重试',
messageFailed: '无法发送',
messageSending: '正在发送',
timeSent: ' 用时 %1',
consolePlaceholder: '输入你的消息...',
listeningIndicator: '正在倾听...',
uploadFile: '上传文件',
speak: '发言'
},
'zh-hant': {
title: '聊天',
send: '發送',
unknownFile: '[類型為\'%1\'的文件]',
unknownCard: '[未知的\'%1\'卡片]',
receiptVat: '消費稅',
receiptTax: '税',
receiptTotal: '總共',
messageRetry: '重試',
messageFailed: '無法發送',
messageSending: '正在發送',
timeSent: ' 於 %1',
consolePlaceholder: '輸入你的訊息...',
listeningIndicator: '正在聆聽...',
uploadFile: '上載檔案',
speak: '發言'
},
'zh-yue': {
title: '傾偈',
send: '傳送',
unknownFile: '[類型係\'%1\'嘅文件]',
unknownCard: '[唔知\'%1\'係咩卡片]',
receiptVat: '消費稅',
receiptTax: '税',
receiptTotal: '總共',
messageRetry: '再嚟一次',
messageFailed: '傳送唔倒',
messageSending: '而家傳送緊',
timeSent: ' 喺 %1',
consolePlaceholder: '輸入你嘅訊息...',
listeningIndicator: '聽緊你講嘢...',
uploadFile: '上載檔案',
speak: '講嘢'
},
'cs-cz': {
title: 'Chat',
send: 'Odeslat',
unknownFile: '[Soubor typu \'%1\']',
unknownCard: '[Neznámá karta \'%1\']',
receiptVat: 'DPH',
receiptTax: 'Daň z prod.',
receiptTotal: 'Celkem',
messageRetry: 'opakovat',
messageFailed: 'nepodařilo se odeslat',
messageSending: 'Odesílání',
timeSent: ' v %1',
consolePlaceholder: 'Napište svou zprávu...',
listeningIndicator: 'Poslouchám...',
uploadFile: 'Nahrát soubor',
speak: 'Použít hlas'
},
'ko-kr': {
title: '채팅',
send: '전송',
unknownFile: '[파일 형식 \'%1\']',
unknownCard: '[알수없는 타입의 카드 \'%1\']',
receiptVat: '부가세',
receiptTax: '세액',
receiptTotal: '합계',
messageRetry: '재전송',
messageFailed: '전송할 수 없습니다',
messageSending: '전송중',
timeSent: ' %1',
consolePlaceholder: '메세지를 입력하세요...',
listeningIndicator: '수신중...',
uploadFile: '',
speak: ''
},
'hu-hu' : {
title: 'Csevegés',
send: 'Küldés',
unknownFile: '[Fájltípus \'%1\']',
unknownCard: '[Ismeretlen kártya \'%1\']',
receiptVat: 'ÁFA',
receiptTax: 'Adó',
receiptTotal: 'Összesen',
messageRetry: 'próbálja újra',
messageFailed: 'nem sikerült elküldeni',
messageSending: 'küldés',
timeSent: '%2 ekkor: %1',
consolePlaceholder: 'Írja be üzenetét...',
listeningIndicator: 'Figyelés...',
uploadFile: '',
speak: ''
},
'sv-se' : {
title: 'Chatt',
send: 'Skicka',
unknownFile: '[Filtyp \'%1\']',
unknownCard: '[Okänt kort \'%1\']',
receiptVat: 'Moms',
receiptTax: 'Skatt',
receiptTotal: 'Totalt',
messageRetry: 'försök igen',
messageFailed: 'kunde inte skicka',
messageSending: 'skickar',
timeSent: '%2 %1',
consolePlaceholder: 'Skriv ett meddelande...',
listeningIndicator: 'Lyssnar...',
uploadFile: '',
speak: ''
},
'tr-tr' : {
title: 'Sohbet',
send: 'Gönder',
unknownFile: '[Dosya türü: \'%1\']',
unknownCard: '[Bilinmeyen Kart: \'%1\']',
receiptVat: 'KDV',
receiptTax: 'Vergi',
receiptTotal: 'Toplam',
messageRetry: 'yeniden deneyin',
messageFailed: 'gönderilemedi',
messageSending: 'gönderiliyor',
timeSent: '%2, %1',
consolePlaceholder: 'İletinizi yazın...',
listeningIndicator: 'Dinliyor...',
uploadFile: '',
speak: ''
},
'pt-pt' : {
title: 'Chat',
send: 'Enviar',
unknownFile: '[Ficheiro do tipo "%1"]',
unknownCard: '[Cartão Desconhecido "%1"]',
receiptVat: 'IVA',
receiptTax: 'Imposto',
receiptTotal: 'Total',
messageRetry: 'repetir',
messageFailed: 'não foi possível enviar',
messageSending: 'a enviar',
timeSent: '%2 em %1',
consolePlaceholder: 'Escreva a sua mensagem...',
listeningIndicator: 'A Escutar...',
uploadFile: '',
speak: ''
},
'fi-fi' : {
title: 'Chat',
send: 'Lähetä',
unknownFile: '[Tiedosto tyyppiä \'%1\']',
unknownCard: '[Tuntematon kortti \'%1\']',
receiptVat: 'ALV',
receiptTax: 'Vero',
receiptTotal: 'Yhteensä',
messageRetry: 'yritä uudelleen',
messageFailed: 'ei voitu lähettää',
messageSending: 'lähettää',
timeSent: ' klo %1',
consolePlaceholder: 'Kirjoita viesti...',
listeningIndicator: 'Kuuntelee...',
uploadFile: 'Lataa tiedosto',
speak: 'Puhu'
}
};
export const defaultStrings = localizedStrings['en-us'];
// Returns strings using the "best match available"" locale
// e.g. if 'en-us' is the only supported English locale, then
// strings('en') should return localizedStrings('en-us')
function mapLocale(locale: string) {
locale = locale && locale.toLowerCase();
if (locale in localizedStrings) {
return locale;
} else if (locale.startsWith('cs')) {
return 'cs-cz';
} else if (locale.startsWith('da')) {
return 'da-dk';
} else if (locale.startsWith('de')) {
return 'de-de';
} else if (locale.startsWith('el')) {
return 'el-gr';
} else if (locale.startsWith('es')) {
return 'es-es';
} else if (locale.startsWith('fi')) {
return 'fi-fi';
} else if (locale.startsWith('fr')) {
return 'fr-fr';
} else if (locale.startsWith('hu')) {
return 'hu-hu';
} else if (locale.startsWith('it')) {
return 'it-it';
} else if (locale.startsWith('ja')) {
return 'ja-jp';
} else if (locale.startsWith('ko')) {
return 'ko-kr';
} else if (locale.startsWith('lv')) {
return 'lv-lv';
} else if (locale.startsWith('nb') || locale.startsWith('nn') || locale.startsWith('no')) {
return 'nb-no';
} else if (locale.startsWith('nl')) {
return 'nl-nl';
} else if (locale.startsWith('pl')) {
return 'pl-pl';
} else if (locale.startsWith('pt')) {
if (locale === 'pt-br') {
return 'pt-br';
} else {
return 'pt-pt';
}
} else if (locale.startsWith('ru')) {
return 'ru-ru';
} else if (locale.startsWith('sv')) {
return 'sv-se';
} else if (locale.startsWith('tr')) {
return 'tr-tr';
} else if (locale.startsWith('zh')) {
if (locale === 'zh-hk' || locale === 'zh-mo' || locale === 'zh-tw') {
return 'zh-hant';
} else {
return 'zh-hans';
}
}
return 'en-us';
}
export const strings = (locale: string) => localizedStrings[mapLocale(locale)];