@lokascript/i18n 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +286 -0
  2. package/dist/browser.cjs +7669 -0
  3. package/dist/browser.cjs.map +1 -0
  4. package/dist/browser.d.cts +50 -0
  5. package/dist/browser.d.ts +50 -0
  6. package/dist/browser.js +7592 -0
  7. package/dist/browser.js.map +1 -0
  8. package/dist/hyperfixi-i18n.min.js +2 -0
  9. package/dist/hyperfixi-i18n.min.js.map +1 -0
  10. package/dist/hyperfixi-i18n.mjs +8558 -0
  11. package/dist/hyperfixi-i18n.mjs.map +1 -0
  12. package/dist/index.cjs +14205 -0
  13. package/dist/index.cjs.map +1 -0
  14. package/dist/index.d.cts +947 -0
  15. package/dist/index.d.ts +947 -0
  16. package/dist/index.js +14095 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/transformer-Ckask-yw.d.cts +1041 -0
  19. package/dist/transformer-Ckask-yw.d.ts +1041 -0
  20. package/package.json +84 -0
  21. package/src/browser.ts +122 -0
  22. package/src/compatibility/browser-tests/grammar-demo.spec.ts +169 -0
  23. package/src/constants.ts +366 -0
  24. package/src/dictionaries/ar.ts +233 -0
  25. package/src/dictionaries/bn.ts +156 -0
  26. package/src/dictionaries/de.ts +233 -0
  27. package/src/dictionaries/derive.ts +515 -0
  28. package/src/dictionaries/en.ts +237 -0
  29. package/src/dictionaries/es.ts +233 -0
  30. package/src/dictionaries/fr.ts +233 -0
  31. package/src/dictionaries/hi.ts +270 -0
  32. package/src/dictionaries/id.ts +233 -0
  33. package/src/dictionaries/index.ts +238 -0
  34. package/src/dictionaries/it.ts +233 -0
  35. package/src/dictionaries/ja.ts +233 -0
  36. package/src/dictionaries/ko.ts +233 -0
  37. package/src/dictionaries/ms.ts +276 -0
  38. package/src/dictionaries/pl.ts +239 -0
  39. package/src/dictionaries/pt.ts +237 -0
  40. package/src/dictionaries/qu.ts +233 -0
  41. package/src/dictionaries/ru.ts +270 -0
  42. package/src/dictionaries/sw.ts +233 -0
  43. package/src/dictionaries/th.ts +156 -0
  44. package/src/dictionaries/tl.ts +276 -0
  45. package/src/dictionaries/tr.ts +233 -0
  46. package/src/dictionaries/uk.ts +270 -0
  47. package/src/dictionaries/vi.ts +210 -0
  48. package/src/dictionaries/zh.ts +233 -0
  49. package/src/enhanced-i18n.test.ts +454 -0
  50. package/src/enhanced-i18n.ts +713 -0
  51. package/src/examples/new-languages.ts +326 -0
  52. package/src/formatting.test.ts +213 -0
  53. package/src/formatting.ts +416 -0
  54. package/src/grammar/direct-mappings.ts +353 -0
  55. package/src/grammar/grammar.test.ts +1053 -0
  56. package/src/grammar/index.ts +59 -0
  57. package/src/grammar/profiles/index.ts +860 -0
  58. package/src/grammar/transformer.ts +1318 -0
  59. package/src/grammar/types.ts +630 -0
  60. package/src/index.ts +202 -0
  61. package/src/new-languages.test.ts +389 -0
  62. package/src/parser/analyze-conflicts.test.ts +229 -0
  63. package/src/parser/ar.ts +40 -0
  64. package/src/parser/create-provider.ts +309 -0
  65. package/src/parser/de.ts +36 -0
  66. package/src/parser/es.ts +31 -0
  67. package/src/parser/fr.ts +31 -0
  68. package/src/parser/id.ts +34 -0
  69. package/src/parser/index.ts +50 -0
  70. package/src/parser/ja.ts +36 -0
  71. package/src/parser/ko.ts +37 -0
  72. package/src/parser/locale-manager.test.ts +198 -0
  73. package/src/parser/locale-manager.ts +197 -0
  74. package/src/parser/parser-integration.test.ts +439 -0
  75. package/src/parser/pt.ts +37 -0
  76. package/src/parser/qu.ts +37 -0
  77. package/src/parser/sw.ts +37 -0
  78. package/src/parser/tr.ts +38 -0
  79. package/src/parser/types.ts +113 -0
  80. package/src/parser/zh.ts +38 -0
  81. package/src/plugins/vite.ts +224 -0
  82. package/src/plugins/webpack.ts +124 -0
  83. package/src/pluralization.test.ts +197 -0
  84. package/src/pluralization.ts +393 -0
  85. package/src/runtime.ts +441 -0
  86. package/src/ssr-integration.ts +225 -0
  87. package/src/test-setup.ts +195 -0
  88. package/src/translation-validation.test.ts +171 -0
  89. package/src/translator.test.ts +252 -0
  90. package/src/translator.ts +297 -0
  91. package/src/types.ts +209 -0
  92. package/src/utils/locale.ts +190 -0
  93. package/src/utils/tokenizer-adapter.ts +469 -0
  94. package/src/utils/tokenizer.ts +19 -0
  95. package/src/validators/index.ts +174 -0
  96. package/src/validators/schema.ts +129 -0
@@ -0,0 +1,276 @@
1
+ /**
2
+ * Tagalog Dictionary
3
+ *
4
+ * Tagalog translations for hyperscript keywords.
5
+ * Tagalog is a VSO (Verb-Subject-Object) language with rich verbal morphology.
6
+ */
7
+
8
+ import { Dictionary } from '../types';
9
+
10
+ export const tagalogDictionary: Dictionary = {
11
+ commands: {
12
+ // Event handling
13
+ on: 'kapag',
14
+ tell: 'sabihin',
15
+ trigger: 'palitawin',
16
+ send: 'ipadala',
17
+
18
+ // DOM manipulation
19
+ take: 'kunin',
20
+ put: 'ilagay',
21
+ set: 'itakda',
22
+ get: 'kuhanin',
23
+ add: 'idagdag',
24
+ remove: 'alisin',
25
+ toggle: 'palitan',
26
+ hide: 'itago',
27
+ show: 'ipakita',
28
+
29
+ // Control flow
30
+ if: 'kung',
31
+ unless: 'maliban_kung',
32
+ repeat: 'ulitin',
33
+ for: 'para_sa',
34
+ while: 'habang',
35
+ until: 'hanggang',
36
+ continue: 'magpatuloy',
37
+ break: 'itigil',
38
+ halt: 'huminto',
39
+
40
+ // Async
41
+ wait: 'maghintay',
42
+ fetch: 'kuhanin_mula',
43
+ call: 'tawagin',
44
+ return: 'ibalik',
45
+
46
+ // Other commands
47
+ make: 'gumawa',
48
+ log: 'itala',
49
+ throw: 'ihagis',
50
+ catch: 'hulihin',
51
+ measure: 'sukatin',
52
+ transition: 'baguhin',
53
+
54
+ // Data Commands
55
+ increment: 'dagdagan',
56
+ decrement: 'bawasan',
57
+ bind: 'itali',
58
+ default: 'pamantayan',
59
+ persist: 'panatilihin',
60
+
61
+ // Navigation Commands
62
+ go: 'pumunta',
63
+ pushUrl: 'itulak_url',
64
+ replaceUrl: 'palitan_url',
65
+
66
+ // Utility Commands
67
+ copy: 'kopyahin',
68
+ pick: 'pumili',
69
+ beep: 'tunog',
70
+
71
+ // Advanced Commands
72
+ js: 'js',
73
+ async: 'sabay',
74
+ render: 'ipakita',
75
+
76
+ // Animation Commands
77
+ swap: 'palitan_pwesto',
78
+ morph: 'baguhin_hugis',
79
+ settle: 'ayusin',
80
+
81
+ // Content Commands
82
+ append: 'idagdag_sa_dulo',
83
+ prepend: 'idagdag_sa_simula',
84
+
85
+ // Control Flow
86
+ exit: 'lumabas',
87
+ else: 'kung_hindi',
88
+
89
+ // Focus Commands
90
+ focus: 'ituon',
91
+ blur: 'alisin_tuon',
92
+
93
+ // Behaviors
94
+ install: 'ikabit',
95
+ behavior: 'ugali',
96
+ init: 'simulan',
97
+ clone: 'kopyahin',
98
+ },
99
+
100
+ modifiers: {
101
+ to: 'sa',
102
+ from: 'mula_sa',
103
+ into: 'papasok_sa',
104
+ with: 'kasama',
105
+ at: 'sa',
106
+ in: 'sa_loob',
107
+ of: 'ng',
108
+ as: 'bilang',
109
+ by: 'sa_pamamagitan_ng',
110
+ before: 'bago',
111
+ after: 'pagkatapos',
112
+ over: 'sa_ibabaw',
113
+ under: 'sa_ilalim',
114
+ between: 'sa_pagitan',
115
+ through: 'sa_pamamagitan',
116
+ without: 'walang',
117
+ on: 'sa',
118
+ then: 'pagkatapos',
119
+ and: 'at',
120
+ end: 'wakas',
121
+ until: 'hanggang',
122
+ },
123
+
124
+ events: {
125
+ click: 'click',
126
+ dblclick: 'dblclick',
127
+ mousedown: 'mousedown',
128
+ mouseup: 'mouseup',
129
+ mouseenter: 'mouseenter',
130
+ mouseleave: 'mouseleave',
131
+ mouseover: 'mouseover',
132
+ mouseout: 'mouseout',
133
+ mousemove: 'mousemove',
134
+
135
+ keydown: 'keydown',
136
+ keyup: 'keyup',
137
+ keypress: 'keypress',
138
+
139
+ focus: 'focus',
140
+ blur: 'blur',
141
+ change: 'change',
142
+ input: 'input',
143
+ submit: 'submit',
144
+ reset: 'reset',
145
+
146
+ load: 'load',
147
+ unload: 'unload',
148
+ resize: 'resize',
149
+ scroll: 'scroll',
150
+
151
+ touchstart: 'touchstart',
152
+ touchend: 'touchend',
153
+ touchmove: 'touchmove',
154
+ touchcancel: 'touchcancel',
155
+
156
+ every: 'bawat',
157
+ },
158
+
159
+ logical: {
160
+ when: 'kapag',
161
+ where: 'kung_saan',
162
+ and: 'at',
163
+ or: 'o',
164
+ not: 'hindi',
165
+ is: 'ay',
166
+ exists: 'may',
167
+ matches: 'tumutugma',
168
+ contains: 'naglalaman',
169
+ includes: 'kasama',
170
+ equals: 'katumbas',
171
+ has: 'may', // possession verb (context-based)
172
+ have: 'may', // same for first/third person in Tagalog
173
+ then: 'pagkatapos',
174
+ else: 'kung_hindi',
175
+ otherwise: 'kung_hindi_man',
176
+ end: 'wakas',
177
+ if: 'kung',
178
+ empty: 'walang_laman',
179
+ true: 'totoo',
180
+ false: 'mali',
181
+ null: 'wala',
182
+ undefined: 'hindi_tinukoy',
183
+ },
184
+
185
+ temporal: {
186
+ seconds: 'segundo',
187
+ second: 'segundo',
188
+ milliseconds: 'milisegundo',
189
+ millisecond: 'milisegundo',
190
+ minutes: 'minuto',
191
+ minute: 'minuto',
192
+ hours: 'oras',
193
+ hour: 'oras',
194
+ ms: 'ms',
195
+ s: 's',
196
+ min: 'min',
197
+ h: 'h',
198
+ now: 'ngayon',
199
+ forever: 'magpakailanman',
200
+ times: 'beses',
201
+ },
202
+
203
+ values: {
204
+ true: 'totoo',
205
+ false: 'mali',
206
+ null: 'wala',
207
+ undefined: 'hindi_tinukoy',
208
+ it: 'ito',
209
+ its: 'nito',
210
+ me: 'ako',
211
+ my: 'aking',
212
+ myself: 'sarili_ko',
213
+ you: 'ikaw',
214
+ your: 'iyong',
215
+ yourself: 'sarili_mo',
216
+ element: 'elemento',
217
+ target: 'target',
218
+ detail: 'detalye',
219
+ event: 'pangyayari',
220
+ window: 'bintana',
221
+ document: 'dokumento',
222
+ body: 'katawan',
223
+ result: 'resulta',
224
+ value: 'halaga',
225
+ },
226
+
227
+ attributes: {
228
+ class: 'klase',
229
+ classes: 'mga_klase',
230
+ style: 'estilo',
231
+ styles: 'mga_estilo',
232
+ attribute: 'katangian',
233
+ attributes: 'mga_katangian',
234
+ property: 'ari_arian',
235
+ properties: 'mga_ari_arian',
236
+ id: 'id',
237
+ value: 'halaga',
238
+ text: 'teksto',
239
+ html: 'html',
240
+ disabled: 'hindi_pinagana',
241
+ checked: 'naka_tsek',
242
+ },
243
+
244
+ expressions: {
245
+ // Positional
246
+ first: 'una',
247
+ last: 'huli',
248
+ next: 'susunod',
249
+ previous: 'nakaraan',
250
+ prev: 'nakaraan',
251
+ at: 'sa',
252
+ random: 'random',
253
+
254
+ // DOM Traversal
255
+ closest: 'pinakamalapit',
256
+ parent: 'magulang',
257
+ children: 'mga_anak',
258
+ within: 'sa_loob_ng',
259
+
260
+ // Emptiness/Existence
261
+ no: 'walang',
262
+ empty: 'walang_laman',
263
+ some: 'ilan',
264
+
265
+ // String operations
266
+ 'starts with': 'nagsisimula_sa',
267
+ 'ends with': 'nagtatapos_sa',
268
+
269
+ // Additional
270
+ length: 'haba',
271
+ index: 'indeks',
272
+ },
273
+ };
274
+
275
+ // Default export alias
276
+ export const tl = tagalogDictionary;
@@ -0,0 +1,233 @@
1
+ // packages/i18n/src/dictionaries/tr.ts
2
+
3
+ import { Dictionary } from '../types';
4
+
5
+ export const tr: Dictionary = {
6
+ commands: {
7
+ // Event handling
8
+ on: 'üzerinde',
9
+ tell: 'söyle',
10
+ trigger: 'tetikle',
11
+ send: 'gönder',
12
+
13
+ // DOM manipulation
14
+ take: 'al',
15
+ put: 'koy',
16
+ set: 'ayarla',
17
+ get: 'al',
18
+ add: 'ekle',
19
+ remove: 'kaldır',
20
+ toggle: 'değiştir',
21
+ hide: 'gizle',
22
+ show: 'göster',
23
+
24
+ // Control flow
25
+ if: 'eğer',
26
+ unless: 'değilse',
27
+ repeat: 'tekrarla',
28
+ for: 'için',
29
+ while: 'iken',
30
+ until: 'kadar',
31
+ continue: 'devam',
32
+ break: 'dur',
33
+ halt: 'durdur',
34
+
35
+ // Async
36
+ wait: 'bekle',
37
+ fetch: 'getir',
38
+ call: 'çağır',
39
+ return: 'dön',
40
+
41
+ // Other commands
42
+ make: 'yap',
43
+ log: 'kaydet',
44
+ throw: 'fırlat',
45
+ catch: 'yakala',
46
+ measure: 'ölç',
47
+ transition: 'geçiş',
48
+
49
+ // Data Commands
50
+ increment: 'artır',
51
+ decrement: 'azalt',
52
+ bind: 'bağla',
53
+ default: 'varsayılan',
54
+ persist: 'kalıcı',
55
+
56
+ // Navigation Commands
57
+ go: 'git',
58
+ pushUrl: 'urlEkle',
59
+ replaceUrl: 'urlDeğiştir',
60
+
61
+ // Utility Commands
62
+ copy: 'kopyala',
63
+ pick: 'seç',
64
+ beep: 'bip',
65
+
66
+ // Advanced Commands
67
+ js: 'js',
68
+ async: 'asenkron',
69
+ render: 'render',
70
+
71
+ // Animation Commands
72
+ swap: 'takas',
73
+ morph: 'dönüştür',
74
+ settle: 'sabitlen',
75
+
76
+ // Content Commands
77
+ append: 'ekle',
78
+
79
+ // Control Flow
80
+ exit: 'çık',
81
+
82
+ // Behaviors
83
+ install: 'kur',
84
+ },
85
+
86
+ modifiers: {
87
+ to: 'e',
88
+ from: 'den',
89
+ into: 'içine',
90
+ with: 'ile',
91
+ at: 'de',
92
+ in: 'içinde',
93
+ of: 'nin',
94
+ as: 'olarak',
95
+ by: 'tarafından',
96
+ before: 'önce',
97
+ after: 'sonra',
98
+ over: 'üzerinde',
99
+ under: 'altında',
100
+ between: 'arasında',
101
+ through: 'boyunca',
102
+ without: 'olmadan',
103
+ },
104
+
105
+ events: {
106
+ click: 'tıklama',
107
+ dblclick: 'çift_tıklama',
108
+ mousedown: 'fare_bas',
109
+ mouseup: 'fare_bırak',
110
+ mouseenter: 'fare_gir',
111
+ mouseleave: 'fare_çık',
112
+ mouseover: 'fare_üstü',
113
+ mouseout: 'fare_dışı',
114
+ mousemove: 'fare_hareket',
115
+
116
+ keydown: 'tuş_bas',
117
+ keyup: 'tuş_bırak',
118
+ keypress: 'tuş_basım',
119
+
120
+ focus: 'odak',
121
+ blur: 'bulanık',
122
+ change: 'değişim',
123
+ input: 'giriş',
124
+ submit: 'gönder',
125
+ reset: 'sıfırla',
126
+
127
+ load: 'yükle',
128
+ unload: 'yükle_kaldır',
129
+ resize: 'boyut_değiştir',
130
+ scroll: 'kaydır',
131
+
132
+ touchstart: 'dokunma_başla',
133
+ touchend: 'dokunma_bitir',
134
+ touchmove: 'dokunma_hareket',
135
+ touchcancel: 'dokunma_iptal',
136
+ },
137
+
138
+ logical: {
139
+ when: 'iken', // REVIEW: native speaker - could also be 'durumunda' (in case of) or 'olduğunda' (when it happens)
140
+ where: 'nerede', // REVIEW: native speaker - element filter context
141
+ and: 've',
142
+ or: 'veya',
143
+ not: 'değil',
144
+ is: 'dir',
145
+ exists: 'var',
146
+ matches: 'eşleşir',
147
+ contains: 'içerir',
148
+ includes: 'dahil',
149
+ equals: 'eşittir',
150
+ has: 'var', // existence marker (context-based)
151
+ have: 'var', // same for first/third person in Turkish
152
+ then: 'sonra',
153
+ else: 'yoksa',
154
+ otherwise: 'aksi_halde',
155
+ end: 'son',
156
+ },
157
+
158
+ temporal: {
159
+ seconds: 'saniye',
160
+ second: 'saniye',
161
+ milliseconds: 'milisaniye',
162
+ millisecond: 'milisaniye',
163
+ minutes: 'dakika',
164
+ minute: 'dakika',
165
+ hours: 'saat',
166
+ hour: 'saat',
167
+ ms: 'ms',
168
+ s: 's',
169
+ min: 'dk',
170
+ h: 'sa',
171
+ },
172
+
173
+ values: {
174
+ true: 'doğru',
175
+ false: 'yanlış',
176
+ null: 'boş',
177
+ undefined: 'tanımsız',
178
+ it: 'o',
179
+ its: 'onun', // REVIEW: native speaker
180
+ me: 'ben',
181
+ my: 'benim',
182
+ myself: 'kendim',
183
+ you: 'sen', // REVIEW: native speaker - formal/informal
184
+ your: 'senin', // REVIEW: native speaker - formal/informal
185
+ yourself: 'kendin', // REVIEW: native speaker
186
+ element: 'öğe',
187
+ target: 'hedef',
188
+ detail: 'detay',
189
+ event: 'olay',
190
+ window: 'pencere',
191
+ document: 'belge',
192
+ body: 'gövde',
193
+ result: 'sonuç',
194
+ value: 'değer',
195
+ },
196
+
197
+ attributes: {
198
+ class: 'sınıf',
199
+ classes: 'sınıflar',
200
+ style: 'stil',
201
+ styles: 'stiller',
202
+ attribute: 'özellik',
203
+ attributes: 'özellikler',
204
+ property: 'özellik',
205
+ properties: 'özellikler',
206
+ },
207
+
208
+ expressions: {
209
+ // Positional
210
+ first: 'ilk',
211
+ last: 'son',
212
+ next: 'sonraki',
213
+ previous: 'önceki',
214
+ prev: 'önc',
215
+ at: 'de',
216
+ random: 'rastgele',
217
+
218
+ // DOM Traversal
219
+ closest: 'en_yakın',
220
+ parent: 'ebeveyn',
221
+ children: 'çocuklar',
222
+ within: 'içinde',
223
+
224
+ // Emptiness/Existence
225
+ no: 'yok',
226
+ empty: 'boş',
227
+ some: 'bazı',
228
+
229
+ // String operations
230
+ 'starts with': 'ile başlar',
231
+ 'ends with': 'ile biter',
232
+ },
233
+ };