-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18n.js
More file actions
635 lines (624 loc) · 31.1 KB
/
i18n.js
File metadata and controls
635 lines (624 loc) · 31.1 KB
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
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
/*
* SPDX-FileCopyrightText: 2026 John Samuel <johnsamuelwrites@gmail.com>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
"use strict";
export const UI_STRINGS = {
en: {
label_language: "Language",
label_example: "Example",
btn_run: "Run",
btn_clear: "Clear",
btn_share: "Share",
btn_copy: "Copy",
tab_output: "Output",
example_basics: "Basics",
example_medium: "Medium",
example_advanced: "Advanced",
pane_source: "Source Code",
status_loading: "Loading runtimes…",
status_packages: "Pyodide ready — installing packages…",
status_ready_full: "Ready ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt unavailable — WAT execution disabled)",
status_still_loading: "Still loading…",
status_running: "Running…",
status_done: "Done",
status_error: "Error",
out_empty: "Output will appear here after clicking ▶ Run.",
out_no_output: "(no output)",
out_no_python: "(no Python source generated)",
out_no_rust: "(no Rust source generated)",
out_python_placeholder: "Generated Python source will appear here.",
out_wat_placeholder: "WAT source will appear here after clicking ▶ Run.",
out_wasm_placeholder: "WASM execution output will appear here.",
out_rust_placeholder: "Generated Rust source will appear here after clicking ▶ Run.",
out_run_hints_placeholder: "Local run instructions will appear here.",
lang_auto_detected: "Language auto-detected as '{detected}' (was '{was}'). Language selector updated.",
warning_prefix: "Warning: ",
share_failed: "Share failed: code could not be encoded.",
copied: "✓ Copied!",
},
fr: {
label_language: "Langue",
label_example: "Exemple",
btn_run: "Exécuter",
btn_clear: "Effacer",
btn_share: "Partager",
btn_copy: "Copier",
tab_output: "Sortie",
example_basics: "Bases",
example_medium: "Intermédiaire",
example_advanced: "Avancé",
pane_source: "Code source",
status_loading: "Chargement des environnements…",
status_packages: "Pyodide prêt — installation des paquets…",
status_ready_full: "Prêt ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt indisponible — exécution WAT désactivée)",
status_still_loading: "Toujours en chargement…",
status_running: "Exécution en cours…",
status_done: "Terminé",
status_error: "Erreur",
out_empty: "La sortie apparaîtra ici après avoir cliqué sur ▶ Exécuter.",
out_no_output: "(aucune sortie)",
out_no_python: "(aucun code Python généré)",
out_no_rust: "(aucun code Rust généré)",
out_python_placeholder: "Le code Python généré apparaîtra ici.",
out_wat_placeholder: "Le code WAT apparaîtra ici après exécution.",
out_wasm_placeholder: "La sortie d'exécution WASM apparaîtra ici.",
out_rust_placeholder: "Le code Rust généré apparaîtra ici après exécution.",
out_run_hints_placeholder: "Les instructions d'exécution locale apparaîtront ici.",
lang_auto_detected: "Langue détectée : '{detected}' (était '{was}'). Sélecteur mis à jour.",
warning_prefix: "Avertissement : ",
share_failed: "Partage échoué : le code n'a pu être encodé.",
copied: "✓ Copié !",
},
es: {
label_language: "Idioma",
label_example: "Ejemplo",
btn_run: "Ejecutar",
btn_clear: "Borrar",
btn_share: "Compartir",
btn_copy: "Copiar",
tab_output: "Salida",
example_basics: "Básico",
example_medium: "Intermedio",
example_advanced: "Avanzado",
pane_source: "Código fuente",
status_loading: "Cargando entornos…",
status_packages: "Pyodide listo — instalando paquetes…",
status_ready_full: "Listo ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt no disponible — ejecución WAT desactivada)",
status_still_loading: "Aún cargando…",
status_running: "Ejecutando…",
status_done: "Listo",
status_error: "Error",
out_empty: "La salida aparecerá aquí tras pulsar ▶ Ejecutar.",
out_no_output: "(sin salida)",
out_no_python: "(ningún código Python generado)",
out_no_rust: "(ningún código Rust generado)",
out_python_placeholder: "El código Python generado aparecerá aquí.",
out_wat_placeholder: "El código WAT aparecerá aquí tras ejecutar.",
out_wasm_placeholder: "La salida de ejecución WASM aparecerá aquí.",
out_rust_placeholder: "El código Rust generado aparecerá aquí tras ejecutar.",
out_run_hints_placeholder: "Las instrucciones de ejecución local aparecerán aquí.",
lang_auto_detected: "Idioma detectado: '{detected}' (era '{was}'). Selector actualizado.",
warning_prefix: "Advertencia: ",
share_failed: "Error al compartir: el código no pudo codificarse.",
copied: "✓ ¡Copiado!",
},
de: {
label_language: "Sprache",
label_example: "Beispiel",
btn_run: "Ausführen",
btn_clear: "Löschen",
btn_share: "Teilen",
btn_copy: "Kopieren",
tab_output: "Ausgabe",
example_basics: "Grundlagen",
example_medium: "Mittel",
example_advanced: "Fortgeschritten",
pane_source: "Quellcode",
status_loading: "Laufzeitumgebungen werden geladen…",
status_packages: "Pyodide bereit — Pakete werden installiert…",
status_ready_full: "Bereit ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt nicht verfügbar — WAT-Ausführung deaktiviert)",
status_still_loading: "Noch am Laden…",
status_running: "Ausführen…",
status_done: "Fertig",
status_error: "Fehler",
out_empty: "Die Ausgabe erscheint hier nach Klick auf ▶ Ausführen.",
out_no_output: "(keine Ausgabe)",
out_no_python: "(kein Python-Code generiert)",
out_no_rust: "(kein Rust-Code generiert)",
out_python_placeholder: "Generierter Python-Quellcode erscheint hier.",
out_wat_placeholder: "WAT-Quellcode erscheint hier nach dem Ausführen.",
out_wasm_placeholder: "WASM-Ausführungsausgabe erscheint hier.",
out_rust_placeholder: "Generierter Rust-Quellcode erscheint hier nach dem Ausführen.",
out_run_hints_placeholder: "Lokale Ausführungsanweisungen erscheinen hier.",
lang_auto_detected: "Sprache erkannt: '{detected}' (war '{was}'). Auswahl aktualisiert.",
warning_prefix: "Warnung: ",
share_failed: "Teilen fehlgeschlagen: Code konnte nicht kodiert werden.",
copied: "✓ Kopiert!",
},
it: {
label_language: "Lingua",
label_example: "Esempio",
btn_run: "Esegui",
btn_clear: "Cancella",
btn_share: "Condividi",
btn_copy: "Copia",
tab_output: "Output",
example_basics: "Basi",
example_medium: "Intermedio",
example_advanced: "Avanzato",
pane_source: "Codice sorgente",
status_loading: "Caricamento ambienti…",
status_packages: "Pyodide pronto — installazione pacchetti…",
status_ready_full: "Pronto ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt non disponibile — esecuzione WAT disabilitata)",
status_still_loading: "Ancora in caricamento…",
status_running: "Esecuzione…",
status_done: "Fatto",
status_error: "Errore",
out_empty: "L'output apparirà qui dopo aver cliccato su ▶ Esegui.",
out_no_output: "(nessun output)",
out_no_python: "(nessun codice Python generato)",
out_no_rust: "(nessun codice Rust generato)",
out_python_placeholder: "Il codice Python generato apparirà qui.",
out_wat_placeholder: "Il codice WAT apparirà qui dopo l'esecuzione.",
out_wasm_placeholder: "L'output di esecuzione WASM apparirà qui.",
out_rust_placeholder: "Il codice Rust generato apparirà qui dopo l'esecuzione.",
out_run_hints_placeholder: "Le istruzioni di esecuzione locale appariranno qui.",
lang_auto_detected: "Lingua rilevata: '{detected}' (era '{was}'). Selezione aggiornata.",
warning_prefix: "Avviso: ",
share_failed: "Condivisione fallita: il codice non è stato codificato.",
copied: "✓ Copiato!",
},
pt: {
label_language: "Idioma",
label_example: "Exemplo",
btn_run: "Executar",
btn_clear: "Limpar",
btn_share: "Partilhar",
btn_copy: "Copiar",
tab_output: "Saída",
example_basics: "Básico",
example_medium: "Médio",
example_advanced: "Avançado",
pane_source: "Código fonte",
status_loading: "Carregando ambientes…",
status_packages: "Pyodide pronto — instalando pacotes…",
status_ready_full: "Pronto ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt indisponível — execução WAT desativada)",
status_still_loading: "Ainda carregando…",
status_running: "Executando…",
status_done: "Concluído",
status_error: "Erro",
out_empty: "A saída aparecerá aqui após clicar em ▶ Executar.",
out_no_output: "(sem saída)",
out_no_python: "(nenhum código Python gerado)",
out_no_rust: "(nenhum código Rust gerado)",
out_python_placeholder: "O código Python gerado aparecerá aqui.",
out_wat_placeholder: "O código WAT aparecerá aqui após executar.",
out_wasm_placeholder: "A saída de execução WASM aparecerá aqui.",
out_rust_placeholder: "O código Rust gerado aparecerá aqui após executar.",
out_run_hints_placeholder: "As instruções de execução local aparecerão aqui.",
lang_auto_detected: "Idioma detectado: '{detected}' (era '{was}'). Seletor atualizado.",
warning_prefix: "Aviso: ",
share_failed: "Partilha falhou: o código não pôde ser codificado.",
copied: "✓ Copiado!",
},
nl: {
label_language: "Taal",
label_example: "Voorbeeld",
btn_run: "Uitvoeren",
btn_clear: "Wissen",
btn_share: "Delen",
btn_copy: "Kopiëren",
tab_output: "Uitvoer",
example_basics: "Basis",
example_medium: "Gemiddeld",
example_advanced: "Gevorderd",
pane_source: "Broncode",
status_loading: "Omgevingen laden…",
status_packages: "Pyodide klaar — pakketten installeren…",
status_ready_full: "Klaar ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt niet beschikbaar — WAT-uitvoering uitgeschakeld)",
status_still_loading: "Nog aan het laden…",
status_running: "Uitvoeren…",
status_done: "Klaar",
status_error: "Fout",
out_empty: "De uitvoer verschijnt hier na klikken op ▶ Uitvoeren.",
out_no_output: "(geen uitvoer)",
out_no_python: "(geen Python-code gegenereerd)",
out_no_rust: "(geen Rust-code gegenereerd)",
out_python_placeholder: "Gegenereerde Python-broncode verschijnt hier.",
out_wat_placeholder: "WAT-broncode verschijnt hier na uitvoering.",
out_wasm_placeholder: "WASM-uitvoeringsresultaat verschijnt hier.",
out_rust_placeholder: "Gegenereerde Rust-broncode verschijnt hier na uitvoering.",
out_run_hints_placeholder: "Lokale uitvoeringsinstructies verschijnen hier.",
lang_auto_detected: "Taal gedetecteerd: '{detected}' (was '{was}'). Selectie bijgewerkt.",
warning_prefix: "Waarschuwing: ",
share_failed: "Delen mislukt: code kon niet worden gecodeerd.",
copied: "✓ Gekopieerd!",
},
pl: {
label_language: "Język",
label_example: "Przykład",
btn_run: "Uruchom",
btn_clear: "Wyczyść",
btn_share: "Udostępnij",
btn_copy: "Kopiuj",
tab_output: "Wynik",
example_basics: "Podstawy",
example_medium: "Średni",
example_advanced: "Zaawansowany",
pane_source: "Kod źródłowy",
status_loading: "Ładowanie środowisk…",
status_packages: "Pyodide gotowe — instalowanie pakietów…",
status_ready_full: "Gotowe ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt niedostępny — wykonanie WAT wyłączone)",
status_still_loading: "Jeszcze się ładuje…",
status_running: "Uruchamianie…",
status_done: "Gotowe",
status_error: "Błąd",
out_empty: "Wynik pojawi się tutaj po kliknięciu ▶ Uruchom.",
out_no_output: "(brak wyniku)",
out_no_python: "(brak wygenerowanego kodu Python)",
out_no_rust: "(brak wygenerowanego kodu Rust)",
out_python_placeholder: "Wygenerowany kod źródłowy Python pojawi się tutaj.",
out_wat_placeholder: "Kod WAT pojawi się tutaj po uruchomieniu.",
out_wasm_placeholder: "Wynik wykonania WASM pojawi się tutaj.",
out_rust_placeholder: "Wygenerowany kod Rust pojawi się tutaj po uruchomieniu.",
out_run_hints_placeholder: "Lokalne instrukcje uruchomienia pojawią się tutaj.",
lang_auto_detected: "Wykryto język: '{detected}' (był '{was}'). Selektor zaktualizowany.",
warning_prefix: "Ostrzeżenie: ",
share_failed: "Udostępnianie nie powiodło się: kod nie mógł zostać zakodowany.",
copied: "✓ Skopiowano!",
},
sv: {
label_language: "Språk",
label_example: "Exempel",
btn_run: "Kör",
btn_clear: "Rensa",
btn_share: "Dela",
btn_copy: "Kopiera",
tab_output: "Utdata",
example_basics: "Grunder",
example_medium: "Mellannivå",
example_advanced: "Avancerat",
pane_source: "Källkod",
status_loading: "Laddar miljöer…",
status_packages: "Pyodide klart — installerar paket…",
status_ready_full: "Klart ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt otillgängligt — WAT-körning inaktiverad)",
status_still_loading: "Laddar fortfarande…",
status_running: "Kör…",
status_done: "Klar",
status_error: "Fel",
out_empty: "Utdata visas här efter att ha klickat på ▶ Kör.",
out_no_output: "(ingen utdata)",
out_no_python: "(ingen Python-kod genererad)",
out_no_rust: "(ingen Rust-kod genererad)",
out_python_placeholder: "Genererad Python-källkod visas här.",
out_wat_placeholder: "WAT-källkod visas här efter körning.",
out_wasm_placeholder: "WASM-körningsresultat visas här.",
out_rust_placeholder: "Genererad Rust-källkod visas här efter körning.",
out_run_hints_placeholder: "Lokala körningsinstruktioner visas här.",
lang_auto_detected: "Språk identifierat: '{detected}' (var '{was}'). Väljare uppdaterad.",
warning_prefix: "Varning: ",
share_failed: "Delning misslyckades: koden kunde inte kodas.",
copied: "✓ Kopierat!",
},
da: {
label_language: "Sprog",
label_example: "Eksempel",
btn_run: "Kør",
btn_clear: "Ryd",
btn_share: "Del",
btn_copy: "Kopier",
tab_output: "Output",
example_basics: "Grundlæggende",
example_medium: "Mellemtrin",
example_advanced: "Avanceret",
pane_source: "Kildekode",
status_loading: "Indlæser miljøer…",
status_packages: "Pyodide klar — installerer pakker…",
status_ready_full: "Klar ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt utilgængelig — WAT-kørsel deaktiveret)",
status_still_loading: "Indlæser stadig…",
status_running: "Kører…",
status_done: "Færdig",
status_error: "Fejl",
out_empty: "Output vises her efter klik på ▶ Kør.",
out_no_output: "(ingen output)",
out_no_python: "(ingen Python-kode genereret)",
out_no_rust: "(ingen Rust-kode genereret)",
out_python_placeholder: "Genereret Python-kildekode vises her.",
out_wat_placeholder: "WAT-kildekode vises her efter kørsel.",
out_wasm_placeholder: "WASM-køringsoutput vises her.",
out_rust_placeholder: "Genereret Rust-kildekode vises her efter kørsel.",
out_run_hints_placeholder: "Lokale kørselsanvisninger vises her.",
lang_auto_detected: "Sprog fundet: '{detected}' (var '{was}'). Vælger opdateret.",
warning_prefix: "Advarsel: ",
share_failed: "Deling mislykkedes: koden kunne ikke kodes.",
copied: "✓ Kopieret!",
},
fi: {
label_language: "Kieli",
label_example: "Esimerkki",
btn_run: "Suorita",
btn_clear: "Tyhjennä",
btn_share: "Jaa",
btn_copy: "Kopioi",
tab_output: "Tuloste",
example_basics: "Perusteet",
example_medium: "Keskeinen",
example_advanced: "Edistynyt",
pane_source: "Lähdekoodi",
status_loading: "Ladataan ajoympäristöjä…",
status_packages: "Pyodide valmis — asennetaan paketteja…",
status_ready_full: "Valmis ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt ei saatavilla — WAT-suoritus poistettu käytöstä)",
status_still_loading: "Ladataan vielä…",
status_running: "Suoritetaan…",
status_done: "Valmis",
status_error: "Virhe",
out_empty: "Tuloste näkyy tässä Suorita ▶ -napsautuksen jälkeen.",
out_no_output: "(ei tulostetta)",
out_no_python: "(Python-koodia ei generoitu)",
out_no_rust: "(Rust-koodia ei generoitu)",
out_python_placeholder: "Generoitu Python-lähdekoodi näkyy tässä.",
out_wat_placeholder: "WAT-lähdekoodi näkyy tässä suorituksen jälkeen.",
out_wasm_placeholder: "WASM-suorituksen tuloste näkyy tässä.",
out_rust_placeholder: "Generoitu Rust-lähdekoodi näkyy tässä suorituksen jälkeen.",
out_run_hints_placeholder: "Paikalliset suoritusohjeet näkyvät tässä.",
lang_auto_detected: "Kieli tunnistettu: '{detected}' (oli '{was}'). Valitsin päivitetty.",
warning_prefix: "Varoitus: ",
share_failed: "Jakaminen epäonnistui: koodia ei voitu koodata.",
copied: "✓ Kopioitu!",
},
hi: {
label_language: "भाषा",
label_example: "उदाहरण",
btn_run: "चलाएं",
btn_clear: "साफ़ करें",
btn_share: "साझा करें",
btn_copy: "कॉपी करें",
tab_output: "आउटपुट",
example_basics: "बुनियादी",
example_medium: "मध्यम",
example_advanced: "उन्नत",
pane_source: "स्रोत कोड",
status_loading: "रनटाइम लोड हो रहा है…",
status_packages: "Pyodide तैयार — पैकेज इंस्टॉल हो रहे हैं…",
status_ready_full: "तैयार ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt अनुपलब्ध — WAT निष्पादन अक्षम)",
status_still_loading: "अभी भी लोड हो रहा है…",
status_running: "चल रहा है…",
status_done: "पूर्ण",
status_error: "त्रुटि",
out_empty: "▶ चलाएं क्लिक करने के बाद यहाँ आउटपुट दिखेगा।",
out_no_output: "(कोई आउटपुट नहीं)",
out_no_python: "(कोई Python कोड जेनरेट नहीं हुआ)",
out_no_rust: "(कोई Rust कोड जेनरेट नहीं हुआ)",
out_python_placeholder: "जेनरेट किया गया Python कोड यहाँ दिखेगा।",
out_wat_placeholder: "▶ चलाने के बाद WAT कोड यहाँ दिखेगा।",
out_wasm_placeholder: "WASM का आउटपुट यहाँ दिखेगा।",
out_rust_placeholder: "▶ चलाने के बाद जेनरेट किया Rust कोड यहाँ दिखेगा।",
out_run_hints_placeholder: "स्थानीय चलाने के निर्देश यहाँ दिखेंगे।",
lang_auto_detected: "भाषा पहचानी गई: '{detected}' (पहले थी '{was}'). भाषा चयनकर्ता अपडेट हुआ।",
warning_prefix: "चेतावनी: ",
share_failed: "साझा करना विफल: कोड एन्कोड नहीं हो सका।",
copied: "✓ कॉपी हुआ!",
},
ar: {
label_language: "اللغة",
label_example: "مثال",
btn_run: "تشغيل",
btn_clear: "مسح",
btn_share: "مشاركة",
btn_copy: "نسخ",
tab_output: "المخرجات",
example_basics: "الأساسيات",
example_medium: "متوسط",
example_advanced: "متقدم",
pane_source: "الكود المصدري",
status_loading: "جارٍ تحميل بيئات التشغيل…",
status_packages: "Pyodide جاهز — تثبيت الحزم…",
status_ready_full: "✓ جاهز Pyodide + wabt.js",
status_wabt_unavailable: " (wabt غير متوفر — تنفيذ WAT معطَّل)",
status_still_loading: "لا يزال يُحمَّل…",
status_running: "جارٍ التشغيل…",
status_done: "تم",
status_error: "خطأ",
out_empty: "ستظهر المخرجات هنا بعد النقر على ▶ تشغيل.",
out_no_output: "(لا مخرجات)",
out_no_python: "(لم يُولَّد كود Python)",
out_no_rust: "(لم يُولَّد كود Rust)",
out_python_placeholder: "سيظهر كود Python المُولَّد هنا.",
out_wat_placeholder: "سيظهر كود WAT هنا بعد التشغيل.",
out_wasm_placeholder: "سيظهر ناتج تنفيذ WASM هنا.",
out_rust_placeholder: "سيظهر كود Rust المُولَّد هنا بعد التشغيل.",
out_run_hints_placeholder: "ستظهر هنا تعليمات التشغيل المحلي.",
lang_auto_detected: "اللغة المكتشفة: '{detected}' (كانت '{was}'). تم تحديث المحدد.",
warning_prefix: "تحذير: ",
share_failed: "فشل المشاركة: تعذّر ترميز الكود.",
copied: "✓ تم النسخ!",
},
bn: {
label_language: "ভাষা",
label_example: "উদাহরণ",
btn_run: "চালাও",
btn_clear: "মুছুন",
btn_share: "শেয়ার করুন",
btn_copy: "কপি করুন",
tab_output: "আউটপুট",
example_basics: "মূল বিষয়",
example_medium: "মধ্যম",
example_advanced: "উন্নত",
pane_source: "সোর্স কোড",
status_loading: "রানটাইম লোড হচ্ছে…",
status_packages: "Pyodide তৈরি — প্যাকেজ ইনস্টল হচ্ছে…",
status_ready_full: "তৈরি ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt অনুপলব্ধ — WAT কার্যকর করা অক্ষম)",
status_still_loading: "এখনো লোড হচ্ছে…",
status_running: "চলছে…",
status_done: "সম্পন্ন",
status_error: "ত্রুটি",
out_empty: "▶ চালাও ক্লিক করার পরে এখানে আউটপুট দেখাবে।",
out_no_output: "(কোনো আউটপুট নেই)",
out_no_python: "(কোনো Python কোড তৈরি হয়নি)",
out_no_rust: "(কোনো Rust কোড তৈরি হয়নি)",
out_python_placeholder: "জেনারেট করা Python কোড এখানে দেখাবে।",
out_wat_placeholder: "চালানোর পরে WAT কোড এখানে দেখাবে।",
out_wasm_placeholder: "WASM এক্সিকিউশনের আউটপুট এখানে দেখাবে।",
out_rust_placeholder: "চালানোর পরে জেনারেট করা Rust কোড এখানে দেখাবে।",
out_run_hints_placeholder: "স্থানীয় রান নির্দেশনা এখানে দেখাবে।",
lang_auto_detected: "ভাষা শনাক্ত হয়েছে: '{detected}' (ছিল '{was}'). সিলেক্টর আপডেট হয়েছে।",
warning_prefix: "সতর্কতা: ",
share_failed: "শেয়ার ব্যর্থ: কোড এনকোড করা যায়নি।",
copied: "✓ কপি হয়েছে!",
},
ta: {
label_language: "மொழி",
label_example: "உதாரணம்",
btn_run: "இயக்கு",
btn_clear: "அழி",
btn_share: "பகிர்",
btn_copy: "நகலெடு",
tab_output: "வெளியீடு",
example_basics: "அடிப்படை",
example_medium: "இடைநிலை",
example_advanced: "மேம்பட்ட",
pane_source: "மூலக் குறியீடு",
status_loading: "இயக்க நேர சூழல்கள் ஏற்றப்படுகின்றன…",
status_packages: "Pyodide தயார் — தொகுப்புகள் நிறுவப்படுகின்றன…",
status_ready_full: "தயார் ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt கிடைக்கவில்லை — WAT செயல்படுத்தல் முடக்கப்பட்டது)",
status_still_loading: "இன்னும் ஏற்றப்படுகிறது…",
status_running: "இயங்குகிறது…",
status_done: "முடிந்தது",
status_error: "பிழை",
out_empty: "▶ இயக்கு என்பதை சொடுக்கிய பிறகு வெளியீடு இங்கே தோன்றும்.",
out_no_output: "(வெளியீடு இல்லை)",
out_no_python: "(Python குறியீடு எதுவும் உருவாக்கப்படவில்லை)",
out_no_rust: "(Rust குறியீடு எதுவும் உருவாக்கப்படவில்லை)",
out_python_placeholder: "உருவாக்கப்பட்ட Python மூலக் குறியீடு இங்கே தோன்றும்.",
out_wat_placeholder: "இயக்கிய பிறகு WAT குறியீடு இங்கே தோன்றும்.",
out_wasm_placeholder: "WASM செயலாக்க வெளியீடு இங்கே தோன்றும்.",
out_rust_placeholder: "இயக்கிய பிறகு உருவாக்கப்பட்ட Rust குறியீடு இங்கே தோன்றும்.",
out_run_hints_placeholder: "உள்ளூர் இயக்க வழிமுறைகள் இங்கே தோன்றும்.",
lang_auto_detected: "மொழி கண்டறியப்பட்டது: '{detected}' (இருந்தது '{was}'). தேர்வி புதுப்பிக்கப்பட்டது.",
warning_prefix: "எச்சரிக்கை: ",
share_failed: "பகிர்வு தோல்வி: குறியீட்டை என்கோட் செய்ய முடியவில்லை.",
copied: "✓ நகலெடுக்கப்பட்டது!",
},
zh: {
label_language: "语言",
label_example: "示例",
btn_run: "运行",
btn_clear: "清除",
btn_share: "分享",
btn_copy: "复制",
tab_output: "输出",
example_basics: "基础",
example_medium: "中级",
example_advanced: "高级",
pane_source: "源代码",
status_loading: "正在加载运行时…",
status_packages: "Pyodide 就绪 — 正在安装包…",
status_ready_full: "就绪 ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt 不可用 — WAT 执行已禁用)",
status_still_loading: "仍在加载…",
status_running: "运行中…",
status_done: "完成",
status_error: "错误",
out_empty: "点击 ▶ 运行后,输出将显示在这里。",
out_no_output: "(无输出)",
out_no_python: "(未生成 Python 源代码)",
out_no_rust: "(未生成 Rust 源代码)",
out_python_placeholder: "生成的 Python 源代码将显示在这里。",
out_wat_placeholder: "点击运行后,WAT 源代码将显示在这里。",
out_wasm_placeholder: "WASM 执行输出将显示在这里。",
out_rust_placeholder: "点击运行后,生成的 Rust 源代码将显示在这里。",
out_run_hints_placeholder: "本地运行说明将显示在这里。",
lang_auto_detected: "已自动检测语言:'{detected}'(之前是 '{was}')。选择器已更新。",
warning_prefix: "警告: ",
share_failed: "分享失败:无法编码代码。",
copied: "✓ 已复制!",
},
ja: {
label_language: "言語",
label_example: "例",
btn_run: "実行",
btn_clear: "クリア",
btn_share: "共有",
btn_copy: "コピー",
tab_output: "出力",
example_basics: "基本",
example_medium: "中級",
example_advanced: "上級",
pane_source: "ソースコード",
status_loading: "ランタイムを読み込んでいます…",
status_packages: "Pyodide 準備完了 — パッケージをインストール中…",
status_ready_full: "準備完了 ✓ Pyodide + wabt.js",
status_wabt_unavailable: " (wabt 利用不可 — WAT 実行無効)",
status_still_loading: "まだ読み込み中…",
status_running: "実行中…",
status_done: "完了",
status_error: "エラー",
out_empty: "▶ 実行をクリックすると、ここに出力が表示されます。",
out_no_output: "(出力なし)",
out_no_python: "(Python ソースが生成されませんでした)",
out_no_rust: "(Rust ソースが生成されませんでした)",
out_python_placeholder: "生成された Python ソースコードがここに表示されます。",
out_wat_placeholder: "実行後、WAT ソースコードがここに表示されます。",
out_wasm_placeholder: "WASM の実行出力がここに表示されます。",
out_rust_placeholder: "実行後、生成された Rust ソースコードがここに表示されます。",
out_run_hints_placeholder: "ローカル実行手順がここに表示されます。",
lang_auto_detected: "言語が自動検出されました:'{detected}'(以前は '{was}')。セレクターが更新されました。",
warning_prefix: "警告: ",
share_failed: "共有失敗:コードをエンコードできませんでした。",
copied: "✓ コピーしました!",
},
};
/** Get a translated string, falling back to English. */
export function t(key, lang = 'en') {
const strings = UI_STRINGS[lang] || UI_STRINGS.en;
return strings[key] ?? UI_STRINGS.en[key] ?? key;
}
/** Format a translation that contains {detected} and {was} placeholders. */
export function tAutoDetected(detected, was, lang = 'en') {
return t('lang_auto_detected', lang)
.replace('{detected}', detected)
.replace('{was}', was);
}
const RTL_LANGS = new Set(['ar']);
/**
* Apply translations to all [data-i18n] elements and update button
* title / aria-label attributes for the current language.
*/
export function applyI18n(lang) {
document.documentElement.lang = lang;
document.documentElement.dir = RTL_LANGS.has(lang) ? 'rtl' : 'ltr';
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.dataset.i18n;
const val = t(key, lang);
if (val) el.textContent = val;
});
// Button titles / aria-labels
const runBtn = document.getElementById('run-btn');
if (runBtn) runBtn.title = `${t('btn_run', lang)} (Ctrl+Enter / Cmd+Enter)`;
const clearBtn = document.getElementById('clear-btn');
if (clearBtn) clearBtn.title = t('btn_clear', lang);
const shareBtn = document.getElementById('share-btn');
if (shareBtn) {
shareBtn.title = t('btn_share', lang);
shareBtn.setAttribute('aria-label', t('btn_share', lang));
}
document.querySelectorAll('.copy-btn').forEach(btn => {
btn.title = t('btn_copy', lang);
});
}