@lokascript/i18n 1.3.0 → 2.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 (90) hide show
  1. package/dist/browser.cjs +3625 -3581
  2. package/dist/browser.cjs.map +1 -1
  3. package/dist/browser.d.cts +9 -3
  4. package/dist/browser.d.ts +9 -3
  5. package/dist/browser.js +3595 -3582
  6. package/dist/browser.js.map +1 -1
  7. package/dist/dictionaries/index.cjs +0 -44
  8. package/dist/dictionaries/index.cjs.map +1 -1
  9. package/dist/dictionaries/index.d.cts +29 -80
  10. package/dist/dictionaries/index.d.ts +29 -80
  11. package/dist/dictionaries/index.js +0 -44
  12. package/dist/dictionaries/index.js.map +1 -1
  13. package/dist/index.cjs +7605 -7544
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +36 -36
  16. package/dist/index.d.ts +36 -36
  17. package/dist/index.js +7576 -7545
  18. package/dist/index.js.map +1 -1
  19. package/dist/lokascript-i18n.min.js +1 -1
  20. package/dist/lokascript-i18n.min.js.map +1 -1
  21. package/dist/lokascript-i18n.mjs +3792 -3813
  22. package/dist/lokascript-i18n.mjs.map +1 -1
  23. package/dist/plugins/vite.cjs +0 -42
  24. package/dist/plugins/vite.cjs.map +1 -1
  25. package/dist/plugins/vite.js +0 -42
  26. package/dist/plugins/vite.js.map +1 -1
  27. package/dist/plugins/webpack.cjs +0 -42
  28. package/dist/plugins/webpack.cjs.map +1 -1
  29. package/dist/plugins/webpack.js +0 -42
  30. package/dist/plugins/webpack.js.map +1 -1
  31. package/dist/{transformer-BBKJJ2vd.d.ts → transformer-DN_HqdDB.d.ts} +107 -14
  32. package/dist/{transformer-D8MM2_rz.d.cts → transformer-kXwlqa5b.d.cts} +107 -14
  33. package/package.json +7 -6
  34. package/src/browser.ts +22 -1
  35. package/src/dictionaries/ar.ts +0 -2
  36. package/src/dictionaries/de.ts +0 -2
  37. package/src/dictionaries/derive.ts +0 -2
  38. package/src/dictionaries/en.ts +0 -2
  39. package/src/dictionaries/es.ts +0 -2
  40. package/src/dictionaries/fr.ts +0 -2
  41. package/src/dictionaries/hi.ts +0 -2
  42. package/src/dictionaries/id.ts +0 -2
  43. package/src/dictionaries/index.ts +79 -163
  44. package/src/dictionaries/it.ts +0 -2
  45. package/src/dictionaries/ja.ts +0 -2
  46. package/src/dictionaries/ko.ts +0 -2
  47. package/src/dictionaries/ms.ts +0 -2
  48. package/src/dictionaries/pl.ts +0 -2
  49. package/src/dictionaries/pt.ts +0 -2
  50. package/src/dictionaries/qu.ts +0 -2
  51. package/src/dictionaries/ru.ts +0 -2
  52. package/src/dictionaries/sw.ts +0 -2
  53. package/src/dictionaries/tl.ts +0 -2
  54. package/src/dictionaries/tr.ts +0 -2
  55. package/src/dictionaries/uk.ts +0 -2
  56. package/src/dictionaries/vi.ts +0 -2
  57. package/src/dictionaries/zh.ts +0 -2
  58. package/src/grammar/direct-mappings.ts +0 -2
  59. package/src/grammar/grammar.test.ts +98 -0
  60. package/src/grammar/index.ts +9 -0
  61. package/src/grammar/transformer.ts +125 -73
  62. package/src/index.ts +30 -0
  63. package/src/parser/ar.ts +1 -1
  64. package/src/parser/bn.ts +9 -0
  65. package/src/parser/de.ts +1 -1
  66. package/src/parser/es.ts +1 -1
  67. package/src/parser/fr.ts +1 -1
  68. package/src/parser/hi.ts +9 -0
  69. package/src/parser/id.ts +1 -1
  70. package/src/parser/index.ts +10 -0
  71. package/src/parser/it.ts +9 -0
  72. package/src/parser/ja.ts +1 -1
  73. package/src/parser/ko.ts +1 -1
  74. package/src/parser/locale-manager.ts +1 -1
  75. package/src/parser/ms.ts +9 -0
  76. package/src/parser/pl.ts +9 -0
  77. package/src/parser/pt.ts +1 -1
  78. package/src/parser/qu.ts +1 -1
  79. package/src/parser/ru.ts +9 -0
  80. package/src/parser/sw.ts +1 -1
  81. package/src/parser/th.ts +9 -0
  82. package/src/parser/tl.ts +9 -0
  83. package/src/parser/tr.ts +1 -1
  84. package/src/parser/uk.ts +9 -0
  85. package/src/parser/vi.ts +9 -0
  86. package/src/parser/zh.ts +1 -1
  87. package/src/runtime.test.ts +152 -0
  88. package/src/runtime.ts +32 -13
  89. package/src/utils/locale.test.ts +108 -0
  90. package/src/utils/locale.ts +19 -25
@@ -1,175 +1,92 @@
1
1
  /**
2
2
  * Dictionary Index
3
3
  *
4
- * Exports dictionaries for all supported languages.
4
+ * Exports dictionaries for all 22 supported languages.
5
+ * Each dictionary maps English canonical keywords to locale-specific translations
6
+ * across 8 categories: commands, modifiers, events, logical, temporal, values,
7
+ * attributes, and expressions.
5
8
  *
6
- * Strategy: Dictionaries are derived from semantic profiles where possible,
7
- * with fallbacks to manual definitions for categories not in profiles
8
- * (events, temporal, some values, attributes).
9
- *
10
- * The semantic package's language profiles are the single source of truth
11
- * for command/modifier/logical keyword translations.
12
- *
13
- * TRANSITION NOTE: Currently using full legacy overrides to preserve
14
- * backward compatibility. Once profiles and dictionaries are synchronized,
15
- * the legacy overrides can be reduced to only non-profile categories.
9
+ * Derivation utilities (deriveFromProfile, createEnglishDictionary) are available
10
+ * for generating dictionaries from semantic language profiles. See ./derive.ts.
16
11
  */
17
12
 
18
13
  import { Dictionary } from '../types';
19
14
 
20
- // NOTE: Derivation infrastructure is ready but not yet active.
21
- // The languageProfiles from @lokascript/semantic can be used with deriveFromProfile()
22
- // once we're ready to transition away from legacy dictionaries.
23
- // See ./derive.ts for the derivation utilities.
24
-
25
- // Import legacy dictionaries for overrides
26
- // These provide backward compatibility during the transition period
27
- import { en as enLegacy } from './en';
28
- import { es as esLegacy } from './es';
29
- import { ko as koLegacy } from './ko';
30
- import { zh as zhLegacy } from './zh';
31
- import { fr as frLegacy } from './fr';
32
- import { de as deLegacy } from './de';
33
- import { ja as jaLegacy } from './ja';
34
- import { ar as arLegacy } from './ar';
35
- import { tr as trLegacy } from './tr';
36
- import { id as idLegacy } from './id';
37
- import { qu as quLegacy } from './qu';
38
- import { sw as swLegacy } from './sw';
39
- import { pt as ptLegacy } from './pt';
40
- import { it as itLegacy } from './it';
41
- import { vi as viLegacy } from './vi';
42
- import { pl as plLegacy } from './pl';
43
- import { russianDictionary as ruLegacy } from './ru';
44
- import { ukrainianDictionary as ukLegacy } from './uk';
45
- import { hindiDictionary as hiLegacy } from './hi';
46
- import { bengaliDictionary as bnLegacy } from './bn';
47
- import { thaiDictionary as thLegacy } from './th';
48
- import { malayDictionary as msLegacy } from './ms';
49
- import { tagalogDictionary as tlLegacy } from './tl';
15
+ // Import per-language dictionaries
16
+ import { en as enDict } from './en';
17
+ import { es as esDict } from './es';
18
+ import { ko as koDict } from './ko';
19
+ import { zh as zhDict } from './zh';
20
+ import { fr as frDict } from './fr';
21
+ import { de as deDict } from './de';
22
+ import { ja as jaDict } from './ja';
23
+ import { ar as arDict } from './ar';
24
+ import { tr as trDict } from './tr';
25
+ import { id as idDict } from './id';
26
+ import { qu as quDict } from './qu';
27
+ import { sw as swDict } from './sw';
28
+ import { pt as ptDict } from './pt';
29
+ import { it as itDict } from './it';
30
+ import { vi as viDict } from './vi';
31
+ import { pl as plDict } from './pl';
32
+ import { russianDictionary as ruDict } from './ru';
33
+ import { ukrainianDictionary as ukDict } from './uk';
34
+ import { hindiDictionary as hiDict } from './hi';
35
+ import { bengaliDictionary as bnDict } from './bn';
36
+ import { thaiDictionary as thDict } from './th';
37
+ import { malayDictionary as msDict } from './ms';
38
+ import { tagalogDictionary as tlDict } from './tl';
50
39
 
51
40
  // =============================================================================
52
- // Derived Dictionaries with Legacy Overrides
41
+ // Dictionary Exports
53
42
  // =============================================================================
54
43
 
55
- // For backward compatibility, we use full legacy overrides.
56
- // This ensures no translation changes while establishing the derivation infrastructure.
57
- // Future: Reduce overrides to only non-profile categories as profiles are synchronized.
58
-
59
- /**
60
- * English dictionary - uses legacy values for full compatibility.
61
- */
62
- export const en: Dictionary = enLegacy;
63
-
64
- /**
65
- * Spanish dictionary - legacy overrides for compatibility.
66
- */
67
- export const es: Dictionary = esLegacy;
68
-
69
- /**
70
- * Japanese dictionary - legacy overrides for compatibility.
71
- */
72
- export const ja: Dictionary = jaLegacy;
73
-
74
- /**
75
- * Korean dictionary - legacy overrides for compatibility.
76
- */
77
- export const ko: Dictionary = koLegacy;
78
-
79
- /**
80
- * Chinese dictionary - legacy overrides for compatibility.
81
- */
82
- export const zh: Dictionary = zhLegacy;
83
-
84
- /**
85
- * French dictionary - legacy overrides for compatibility.
86
- */
87
- export const fr: Dictionary = frLegacy;
88
-
89
- /**
90
- * German dictionary - legacy overrides for compatibility.
91
- */
92
- export const de: Dictionary = deLegacy;
93
-
94
- /**
95
- * Arabic dictionary - legacy overrides for compatibility.
96
- */
97
- export const ar: Dictionary = arLegacy;
98
-
99
- /**
100
- * Turkish dictionary - legacy overrides for compatibility.
101
- */
102
- export const tr: Dictionary = trLegacy;
103
-
104
- /**
105
- * Indonesian dictionary - legacy overrides for compatibility.
106
- */
107
- export const id: Dictionary = idLegacy;
108
-
109
- /**
110
- * Portuguese dictionary - legacy overrides for compatibility.
111
- */
112
- export const pt: Dictionary = ptLegacy;
113
-
114
- /**
115
- * Quechua dictionary - legacy overrides for compatibility.
116
- */
117
- export const qu: Dictionary = quLegacy;
118
-
119
- /**
120
- * Swahili dictionary - legacy overrides for compatibility.
121
- */
122
- export const sw: Dictionary = swLegacy;
123
-
124
- /**
125
- * Italian dictionary - legacy overrides for compatibility.
126
- */
127
- export const it: Dictionary = itLegacy;
128
-
129
- /**
130
- * Vietnamese dictionary - legacy overrides for compatibility.
131
- */
132
- export const vi: Dictionary = viLegacy;
133
-
134
- /**
135
- * Polish dictionary - legacy overrides for compatibility.
136
- */
137
- export const pl: Dictionary = plLegacy;
138
-
139
- /**
140
- * Russian dictionary - legacy overrides for compatibility.
141
- */
142
- export const ru: Dictionary = ruLegacy;
143
-
144
- /**
145
- * Ukrainian dictionary - legacy overrides for compatibility.
146
- */
147
- export const uk: Dictionary = ukLegacy;
148
-
149
- /**
150
- * Hindi dictionary - legacy overrides for compatibility.
151
- */
152
- export const hi: Dictionary = hiLegacy;
153
-
154
- /**
155
- * Bengali dictionary - legacy overrides for compatibility.
156
- */
157
- export const bn: Dictionary = bnLegacy;
158
-
159
- /**
160
- * Thai dictionary - legacy overrides for compatibility.
161
- */
162
- export const th: Dictionary = thLegacy;
163
-
164
- /**
165
- * Malay dictionary - legacy overrides for compatibility.
166
- */
167
- export const ms: Dictionary = msLegacy;
168
-
169
- /**
170
- * Tagalog dictionary - legacy overrides for compatibility.
171
- */
172
- export const tl: Dictionary = tlLegacy;
44
+ /** English dictionary */
45
+ export const en: Dictionary = enDict;
46
+ /** Spanish dictionary */
47
+ export const es: Dictionary = esDict;
48
+ /** Japanese dictionary */
49
+ export const ja: Dictionary = jaDict;
50
+ /** Korean dictionary */
51
+ export const ko: Dictionary = koDict;
52
+ /** Chinese dictionary */
53
+ export const zh: Dictionary = zhDict;
54
+ /** French dictionary */
55
+ export const fr: Dictionary = frDict;
56
+ /** German dictionary */
57
+ export const de: Dictionary = deDict;
58
+ /** Arabic dictionary */
59
+ export const ar: Dictionary = arDict;
60
+ /** Turkish dictionary */
61
+ export const tr: Dictionary = trDict;
62
+ /** Indonesian dictionary */
63
+ export const id: Dictionary = idDict;
64
+ /** Portuguese dictionary */
65
+ export const pt: Dictionary = ptDict;
66
+ /** Quechua dictionary */
67
+ export const qu: Dictionary = quDict;
68
+ /** Swahili dictionary */
69
+ export const sw: Dictionary = swDict;
70
+ /** Italian dictionary */
71
+ export const it: Dictionary = itDict;
72
+ /** Vietnamese dictionary */
73
+ export const vi: Dictionary = viDict;
74
+ /** Polish dictionary */
75
+ export const pl: Dictionary = plDict;
76
+ /** Russian dictionary */
77
+ export const ru: Dictionary = ruDict;
78
+ /** Ukrainian dictionary */
79
+ export const uk: Dictionary = ukDict;
80
+ /** Hindi dictionary */
81
+ export const hi: Dictionary = hiDict;
82
+ /** Bengali dictionary */
83
+ export const bn: Dictionary = bnDict;
84
+ /** Thai dictionary */
85
+ export const th: Dictionary = thDict;
86
+ /** Malay dictionary */
87
+ export const ms: Dictionary = msDict;
88
+ /** Tagalog dictionary */
89
+ export const tl: Dictionary = tlDict;
173
90
 
174
91
  // =============================================================================
175
92
  // Dictionary Registry
@@ -228,11 +145,10 @@ export const getDictionary = (locale: string, fallback: string = 'en'): Dictiona
228
145
  };
229
146
 
230
147
  // =============================================================================
231
- // Derivation Utilities (for future use)
148
+ // Derivation Utilities
232
149
  // =============================================================================
233
150
 
234
151
  /**
235
- * Re-export derivation utilities for external use.
236
- * These can be used to derive dictionaries from profiles when ready.
152
+ * Re-export derivation utilities for generating dictionaries from semantic profiles.
237
153
  */
238
154
  export { deriveFromProfile, createEnglishDictionary, validateDictionary } from './derive';
@@ -49,9 +49,7 @@ export const it: Dictionary = {
49
49
  // Data Commands
50
50
  increment: 'incrementare',
51
51
  decrement: 'decrementare',
52
- bind: 'vincolare',
53
52
  default: 'predefinito',
54
- persist: 'persistere',
55
53
 
56
54
  // Navigation Commands
57
55
  go: 'andare',
@@ -49,9 +49,7 @@ export const ja: Dictionary = {
49
49
  // Data Commands
50
50
  increment: '増加',
51
51
  decrement: '減少',
52
- bind: '結合',
53
52
  default: '既定',
54
- persist: '永続化',
55
53
 
56
54
  // Navigation Commands
57
55
  go: '移動',
@@ -49,9 +49,7 @@ export const ko: Dictionary = {
49
49
  // Data Commands
50
50
  increment: '증가',
51
51
  decrement: '감소',
52
- bind: '바인드',
53
52
  default: '기본값',
54
- persist: '유지',
55
53
 
56
54
  // Navigation Commands
57
55
  go: '이동',
@@ -54,9 +54,7 @@ export const malayDictionary: Dictionary = {
54
54
  // Data Commands
55
55
  increment: 'tambah_satu',
56
56
  decrement: 'kurang_satu',
57
- bind: 'ikat',
58
57
  default: 'lalai',
59
- persist: 'kekal',
60
58
 
61
59
  // Navigation Commands
62
60
  go: 'pergi',
@@ -55,9 +55,7 @@ export const pl: Dictionary = {
55
55
  // Data Commands
56
56
  increment: 'zwiększ',
57
57
  decrement: 'zmniejsz',
58
- bind: 'powiąż',
59
58
  default: 'domyślnie',
60
- persist: 'zachowaj',
61
59
 
62
60
  // Navigation Commands
63
61
  go: 'idź',
@@ -53,9 +53,7 @@ export const pt: Dictionary = {
53
53
  // Data Commands
54
54
  increment: 'incrementar',
55
55
  decrement: 'decrementar',
56
- bind: 'vincular',
57
56
  default: 'padrão',
58
- persist: 'persistir',
59
57
 
60
58
  // Navigation Commands
61
59
  go: 'ir',
@@ -49,9 +49,7 @@ export const qu: Dictionary = {
49
49
  // Data Commands
50
50
  increment: 'yapay',
51
51
  decrement: 'pisiyachiy',
52
- bind: 'watay',
53
52
  default: 'ñawpaq_kaq',
54
- persist: 'waqaychay',
55
53
 
56
54
  // Navigation Commands
57
55
  go: 'riy',
@@ -54,9 +54,7 @@ export const russianDictionary: Dictionary = {
54
54
  // Data Commands
55
55
  increment: 'увеличить',
56
56
  decrement: 'уменьшить',
57
- bind: 'связать',
58
57
  default: 'по_умолчанию',
59
- persist: 'сохранить',
60
58
 
61
59
  // Navigation Commands
62
60
  go: 'перейти',
@@ -49,9 +49,7 @@ export const sw: Dictionary = {
49
49
  // Data Commands
50
50
  increment: 'ongeza',
51
51
  decrement: 'punguza',
52
- bind: 'funga',
53
52
  default: 'msingi',
54
- persist: 'hifadhi',
55
53
 
56
54
  // Navigation Commands
57
55
  go: 'nenda',
@@ -54,9 +54,7 @@ export const tagalogDictionary: Dictionary = {
54
54
  // Data Commands
55
55
  increment: 'dagdagan',
56
56
  decrement: 'bawasan',
57
- bind: 'itali',
58
57
  default: 'pamantayan',
59
- persist: 'panatilihin',
60
58
 
61
59
  // Navigation Commands
62
60
  go: 'pumunta',
@@ -49,9 +49,7 @@ export const tr: Dictionary = {
49
49
  // Data Commands
50
50
  increment: 'artır',
51
51
  decrement: 'azalt',
52
- bind: 'bağla',
53
52
  default: 'varsayılan',
54
- persist: 'kalıcı',
55
53
 
56
54
  // Navigation Commands
57
55
  go: 'git',
@@ -54,9 +54,7 @@ export const ukrainianDictionary: Dictionary = {
54
54
  // Data Commands
55
55
  increment: 'збільшити',
56
56
  decrement: 'зменшити',
57
- bind: "прив'язати",
58
57
  default: 'за_замовчуванням',
59
- persist: 'зберегти',
60
58
 
61
59
  // Navigation Commands
62
60
  go: 'перейти',
@@ -49,9 +49,7 @@ export const vi: Dictionary = {
49
49
  // Data Commands
50
50
  increment: 'tăng',
51
51
  decrement: 'giảm',
52
- bind: 'ràng buộc',
53
52
  default: 'mặc định',
54
- persist: 'duy trì',
55
53
 
56
54
  // Navigation Commands
57
55
  go: 'đi đến',
@@ -49,9 +49,7 @@ export const zh: Dictionary = {
49
49
  // Data Commands
50
50
  increment: '增加',
51
51
  decrement: '减少',
52
- bind: '绑定',
53
52
  default: '默认',
54
- persist: '持久化',
55
53
 
56
54
  // Navigation Commands
57
55
  go: '前往',
@@ -197,9 +197,7 @@ export const esPtMapping: DirectMapping = {
197
197
  transición: 'transição', // transition
198
198
  incrementar: 'incrementar', // increment
199
199
  decrementar: 'decrementar', // decrement
200
- vincular: 'vincular', // bind
201
200
  predeterminar: 'padrão', // default
202
- persistir: 'persistir', // persist
203
201
  ir: 'ir', // go
204
202
  copiar: 'copiar', // copy
205
203
  escoger: 'escolher', // pick
@@ -1052,3 +1052,101 @@ describe('Has/Have Operator Translations', () => {
1052
1052
  }
1053
1053
  });
1054
1054
  });
1055
+
1056
+ // =============================================================================
1057
+ // Possessive Dot Notation Translation Tests
1058
+ // =============================================================================
1059
+
1060
+ describe('Possessive Dot Notation Translation', () => {
1061
+ describe('my.property patterns across languages', () => {
1062
+ it('should translate my.textContent to Spanish', () => {
1063
+ const transformer = new GrammarTransformer('en', 'es');
1064
+ const result = transformer.transform('set my.textContent to "Done!"');
1065
+ expect(result).toContain('mi.textContent');
1066
+ expect(result).not.toContain('my.textContent');
1067
+ });
1068
+
1069
+ it('should translate my.textContent to Japanese', () => {
1070
+ const transformer = new GrammarTransformer('en', 'ja');
1071
+ const result = transformer.transform('set my.textContent to "Done!"');
1072
+ expect(result).toContain('私の.textContent');
1073
+ });
1074
+
1075
+ it('should translate my.textContent to German', () => {
1076
+ const transformer = new GrammarTransformer('en', 'de');
1077
+ const result = transformer.transform('set my.textContent to "Done!"');
1078
+ expect(result).toContain('mein.textContent');
1079
+ });
1080
+
1081
+ it('should translate my.textContent to Korean', () => {
1082
+ const transformer = new GrammarTransformer('en', 'ko');
1083
+ const result = transformer.transform('set my.textContent to "Done!"');
1084
+ expect(result).toContain('내.textContent');
1085
+ });
1086
+
1087
+ it('should translate my.textContent to Chinese', () => {
1088
+ const transformer = new GrammarTransformer('en', 'zh');
1089
+ const result = transformer.transform('set my.textContent to "Done!"');
1090
+ expect(result).toContain('我的.textContent');
1091
+ });
1092
+
1093
+ it('should translate my.textContent to Turkish', () => {
1094
+ const transformer = new GrammarTransformer('en', 'tr');
1095
+ const result = transformer.transform('set my.textContent to "Done!"');
1096
+ expect(result).toContain('benim.textContent');
1097
+ });
1098
+
1099
+ it('should translate my.textContent to Arabic', () => {
1100
+ const transformer = new GrammarTransformer('en', 'ar');
1101
+ const result = transformer.transform('set my.textContent to "Done!"');
1102
+ expect(result).toContain('لي.textContent');
1103
+ });
1104
+ });
1105
+
1106
+ describe('its.property and your.property patterns', () => {
1107
+ it('should translate its.value to Spanish', () => {
1108
+ const transformer = new GrammarTransformer('en', 'es');
1109
+ const result = transformer.transform('get its.value');
1110
+ expect(result).toContain('su.value');
1111
+ });
1112
+
1113
+ it('should translate your.name to Spanish', () => {
1114
+ const transformer = new GrammarTransformer('en', 'es');
1115
+ const result = transformer.transform('log your.name');
1116
+ expect(result).toContain('tu.name');
1117
+ });
1118
+ });
1119
+
1120
+ describe('pronoun dot notation (me., it., you.)', () => {
1121
+ it('should translate me.textContent to Spanish', () => {
1122
+ const transformer = new GrammarTransformer('en', 'es');
1123
+ const result = transformer.transform('set me.textContent to "Done!"');
1124
+ expect(result).toContain('mi.textContent');
1125
+ });
1126
+ });
1127
+
1128
+ describe('optional chaining (?.)', () => {
1129
+ it('should translate my?.textContent to Spanish', () => {
1130
+ const transformer = new GrammarTransformer('en', 'es');
1131
+ const result = transformer.transform('log my?.textContent');
1132
+ expect(result).toContain('mi?.textContent');
1133
+ });
1134
+ });
1135
+
1136
+ describe('chained access', () => {
1137
+ it('should only translate the possessive prefix in my.value.toUpperCase()', () => {
1138
+ const transformer = new GrammarTransformer('en', 'es');
1139
+ const result = transformer.transform('put my.value.toUpperCase() into #output');
1140
+ expect(result).toContain('mi.value.toUpperCase()');
1141
+ });
1142
+ });
1143
+
1144
+ describe('backward compatibility', () => {
1145
+ it('should still translate space-separated possessives', () => {
1146
+ const transformer = new GrammarTransformer('en', 'es');
1147
+ const result = transformer.transform('set my textContent to "Done!"');
1148
+ expect(result).toContain('mi');
1149
+ expect(result).not.toMatch(/\bmy\b/);
1150
+ });
1151
+ });
1152
+ });
@@ -37,6 +37,15 @@ export {
37
37
  indonesianProfile,
38
38
  quechuaProfile,
39
39
  swahiliProfile,
40
+ bengaliProfile,
41
+ italianProfile,
42
+ russianProfile,
43
+ ukrainianProfile,
44
+ vietnameseProfile,
45
+ hindiProfile,
46
+ tagalogProfile,
47
+ thaiProfile,
48
+ polishProfile,
40
49
  } from './profiles';
41
50
 
42
51
  // Direct language-pair translation