forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStrings.ts
394 lines (388 loc) · 12.4 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
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: "",
speak: ""
},
'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: " am %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łuchający...",
uploadFile: "",
speak: ""
},
'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: "het luisteren...",
uploadFile: "",
speak: ""
},
'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: "",
speak: ""
},
'fr-fr': {
title: "Chat",
send: "Envoyer",
unknownFile: "[Fichier de type '%1']",
unknownCard: "[Carte inconnue '%1']",
receiptVat: "TVA",
receiptTax: "Taxe",
receiptTotal: "Total",
messageRetry: "reéssayer",
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: "VAT",
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: "",
speak: ""
},
'ko-kr': {
title: "채팅",
send: "전송",
unknownFile: "[파일 형식 '%1']",
unknownCard: "[알수없는 타입의 카드 '%1']",
receiptVat: "부가세",
receiptTax: "세액",
receiptTotal: "합계",
messageRetry: "재전송",
messageFailed: "전송할 수 없습니다",
messageSending: "전송중",
timeSent: " %1",
consolePlaceholder: "메세지를 입력하세요...",
listeningIndicator: "수신중...",
uploadFile: "",
speak: ""
}
}
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')
export const strings = (locale: string) => {
if (locale.startsWith('da'))
locale = 'da-dk';
else if (locale.startsWith('de'))
locale = 'de-de';
else if (locale.startsWith('no') || locale.startsWith('nb') || locale.startsWith('nn'))
locale = 'nb-no';
else if (locale.startsWith('pl'))
locale = 'pl-pl';
else if (locale.startsWith('ru'))
locale = 'ru-ru';
else if (locale.startsWith('nl'))
locale = 'nl-nl';
else if (locale.startsWith('lv'))
locale = 'lv-lv';
else if (locale.startsWith('pt'))
locale = 'pt-br';
else if (locale.startsWith('fr'))
locale = 'fr-fr';
else if (locale.startsWith('es'))
locale = 'es-es';
else if (locale.startsWith('el'))
locale = 'el-gr';
else if (locale.startsWith('it'))
locale = 'it-it';
else if (locale === 'zh-hant' || locale === 'zh-hk' || locale === 'zh-mo' || locale === 'zh-tw')
locale = 'zh-hant';
else if (locale.startsWith('zh'))
locale = 'zh-hans';
else if (locale.startsWith('cs'))
locale = 'cs-cz';
else if (locale.startsWith('ko'))
locale = 'ko-kr';
else if (locale.startsWith('ja'))
locale = 'ja-jp';
else if (locale in localizedStrings === false)
locale = 'en-us';
return localizedStrings[locale];
}