@lokascript/i18n 2.3.0 → 2.4.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 (71) hide show
  1. package/dist/browser.cjs +626 -473
  2. package/dist/browser.cjs.map +1 -1
  3. package/dist/browser.d.cts +25 -3
  4. package/dist/browser.d.ts +25 -3
  5. package/dist/browser.js +623 -474
  6. package/dist/browser.js.map +1 -1
  7. package/dist/dictionaries/index.cjs +489 -472
  8. package/dist/dictionaries/index.cjs.map +1 -1
  9. package/dist/dictionaries/index.d.cts +5 -3
  10. package/dist/dictionaries/index.d.ts +5 -3
  11. package/dist/dictionaries/index.js +489 -473
  12. package/dist/dictionaries/index.js.map +1 -1
  13. package/dist/index.cjs +617 -473
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +37 -37
  16. package/dist/index.d.ts +37 -37
  17. package/dist/index.js +617 -473
  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 +730 -478
  22. package/dist/lokascript-i18n.mjs.map +1 -1
  23. package/dist/plugins/vite.cjs +488 -472
  24. package/dist/plugins/vite.cjs.map +1 -1
  25. package/dist/plugins/vite.js +488 -472
  26. package/dist/plugins/vite.js.map +1 -1
  27. package/dist/plugins/webpack.cjs +488 -472
  28. package/dist/plugins/webpack.cjs.map +1 -1
  29. package/dist/plugins/webpack.js +488 -472
  30. package/dist/plugins/webpack.js.map +1 -1
  31. package/dist/{transformer-B0zy-kti.d.ts → transformer-BLv389qz.d.ts} +12 -47
  32. package/dist/{transformer-CzY_vHU0.d.cts → transformer-PFsYELrc.d.cts} +12 -47
  33. package/dist/{types-BYtpqGq3.d.cts → types-BcALAO6h.d.cts} +1 -1
  34. package/dist/{types-BYtpqGq3.d.ts → types-BcALAO6h.d.ts} +1 -1
  35. package/package.json +5 -5
  36. package/src/browser.ts +3 -0
  37. package/src/constants.ts +9 -0
  38. package/src/dictionaries/ar.ts +22 -43
  39. package/src/dictionaries/bn.ts +17 -0
  40. package/src/dictionaries/de.ts +19 -40
  41. package/src/dictionaries/en.ts +26 -0
  42. package/src/dictionaries/es.ts +19 -40
  43. package/src/dictionaries/fr.ts +19 -40
  44. package/src/dictionaries/he.ts +2 -0
  45. package/src/dictionaries/hi.ts +18 -48
  46. package/src/dictionaries/id.ts +22 -43
  47. package/src/dictionaries/index.ts +5 -1
  48. package/src/dictionaries/it.ts +18 -39
  49. package/src/dictionaries/ja.ts +18 -39
  50. package/src/dictionaries/ko.ts +22 -43
  51. package/src/dictionaries/ms.ts +16 -50
  52. package/src/dictionaries/pl.ts +18 -45
  53. package/src/dictionaries/pt.ts +23 -48
  54. package/src/dictionaries/qu.ts +22 -43
  55. package/src/dictionaries/ru.ts +18 -48
  56. package/src/dictionaries/sw.ts +22 -43
  57. package/src/dictionaries/th.ts +17 -0
  58. package/src/dictionaries/tl.ts +16 -50
  59. package/src/dictionaries/tr.ts +24 -45
  60. package/src/dictionaries/uk.ts +18 -48
  61. package/src/dictionaries/vi.ts +17 -0
  62. package/src/dictionaries/zh.ts +22 -43
  63. package/src/grammar/grammar.test.ts +143 -24
  64. package/src/grammar/index.ts +1 -0
  65. package/src/grammar/profiles/index.ts +31 -0
  66. package/src/grammar/transformer.ts +161 -0
  67. package/src/parser/he.ts +29 -0
  68. package/src/parser/index.ts +1 -0
  69. package/src/schema-alignment.test.ts +154 -0
  70. package/src/test-utils/complete-languages.ts +40 -0
  71. package/src/translation-validation.test.ts +1 -26
@@ -1,5 +1,27 @@
1
- export { A as AdpositionType, E as ENGLISH_COMMANDS, a as ENGLISH_KEYWORDS, G as GrammarRule, b as GrammarTransformer, c as GrammaticalMarker, K as KeywordProvider, d as KeywordProviderOptions, L as LANGUAGE_FAMILY_DEFAULTS, e as LanguageProfile, f as LocaleManager, M as MorphologyType, P as ParsedElement, g as ParsedStatement, h as PatternMatcher, i as PatternTransform, S as SemanticRole, U as UNIVERSAL_ENGLISH_KEYWORDS, j as UNIVERSAL_PATTERNS, W as WordOrder, k as ar, k as arDictionary, l as arKeywords, m as arabicProfile, n as bn, n as bnDictionary, o as bnKeywords, p as chineseProfile, q as createEnglishProvider, r as createKeywordProvider, s as de, s as deDictionary, t as deKeywords, u as detectBrowserLocale, v as englishProfile, w as es, w as esDictionary, x as esKeywords, y as fr, y as frDictionary, z as frKeywords, B as frenchProfile, C as germanProfile, D as getProfile, F as getSupportedLocales, H as grammarExamples, I as hiDictionary, J as hiKeywords, I as hindiDictionary, N as id, N as idDictionary, O as idKeywords, Q as indonesianProfile, R as insertMarkers, T as it, T as itDictionary, V as itKeywords, X as ja, X as jaDictionary, Y as jaKeywords, Z as japaneseProfile, _ as joinTokens, $ as ko, $ as koDictionary, a0 as koKeywords, a1 as koreanProfile, a2 as ms, a2 as msDictionary, a3 as msKeywords, a4 as parseStatement, a5 as pl, a5 as plDictionary, a6 as plKeywords, a7 as portugueseProfile, a8 as profiles, a9 as pt, a9 as ptDictionary, aa as ptKeywords, ab as qu, ab as quDictionary, ac as quKeywords, ad as quechuaProfile, ae as reorderRoles, af as ruDictionary, ag as ruKeywords, af as russianDictionary, ah as spanishProfile, ai as sw, ai as swDictionary, aj as swKeywords, ak as swahiliProfile, al as th, al as thDictionary, am as thKeywords, an as tl, an as tlDictionary, ao as tlKeywords, ap as toEnglish, aq as toLocale, ar as tr, ar as trDictionary, as as trKeywords, at as transformStatement, au as translate, av as turkishProfile, aw as ukDictionary, ax as ukKeywords, aw as ukrainianDictionary, ay as vi, ay as viDictionary, az as viKeywords, aA as zh, aA as zhDictionary, aB as zhKeywords } from './transformer-CzY_vHU0.cjs';
2
- import { D as Dictionary } from './types-BYtpqGq3.cjs';
1
+ import { K as KeywordProvider } from './transformer-PFsYELrc.cjs';
2
+ export { A as AdpositionType, E as ENGLISH_COMMANDS, a as ENGLISH_KEYWORDS, G as GrammarRule, b as GrammarTransformer, c as GrammaticalMarker, d as KeywordProviderOptions, L as LANGUAGE_FAMILY_DEFAULTS, e as LanguageProfile, f as LocaleManager, M as MorphologyType, P as ParsedElement, g as ParsedStatement, h as PatternMatcher, i as PatternTransform, S as SemanticRole, U as UNIVERSAL_ENGLISH_KEYWORDS, j as UNIVERSAL_PATTERNS, W as WordOrder, k as ar, k as arDictionary, l as arKeywords, m as arabicProfile, n as bn, n as bnDictionary, o as bnKeywords, p as chineseProfile, q as createEnglishProvider, r as createKeywordProvider, s as de, s as deDictionary, t as deKeywords, u as detectBrowserLocale, v as englishProfile, w as es, w as esDictionary, x as esKeywords, z as fr, z as frDictionary, B as frKeywords, C as frenchProfile, D as germanProfile, F as getProfile, H as getSupportedLocales, y as grammarExamples, I as hebrewProfile, N as hiDictionary, J as hiKeywords, N as hindiDictionary, O as id, O as idDictionary, Q as idKeywords, R as indonesianProfile, T as insertMarkers, V as it, V as itDictionary, X as itKeywords, Y as ja, Y as jaDictionary, Z as jaKeywords, _ as japaneseProfile, $ as joinTokens, a0 as ko, a0 as koDictionary, a1 as koKeywords, a2 as koreanProfile, a3 as ms, a3 as msDictionary, a4 as msKeywords, a5 as parseStatement, a6 as pl, a6 as plDictionary, a7 as plKeywords, a8 as portugueseProfile, a9 as profiles, aa as pt, aa as ptDictionary, ab as ptKeywords, ac as qu, ac as quDictionary, ad as quKeywords, ae as quechuaProfile, af as reorderRoles, ah as ruDictionary, ag as ruKeywords, ah as russianDictionary, ai as spanishProfile, aj as sw, aj as swDictionary, ak as swKeywords, al as swahiliProfile, am as th, am as thDictionary, an as thKeywords, ao as tl, ao as tlDictionary, ap as tlKeywords, aq as toEnglish, ar as toLocale, as as tr, as as trDictionary, at as trKeywords, au as transformStatement, av as translate, aw as turkishProfile, ay as ukDictionary, ax as ukKeywords, ay as ukrainianDictionary, az as vi, az as viDictionary, aA as viKeywords, aB as zh, aB as zhDictionary, aC as zhKeywords } from './transformer-PFsYELrc.cjs';
3
+ import { a as Dictionary } from './types-BcALAO6h.cjs';
4
+
5
+ declare const he: Dictionary;
6
+
7
+ /**
8
+ * Hebrew keyword provider for the hyperscript parser.
9
+ *
10
+ * Enables parsing hyperscript written in Hebrew (RTL, SVO):
11
+ * - `ב לחיצה מתג .active` → parses as `on click toggle .active`
12
+ *
13
+ * English keywords are also accepted (mixed mode).
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { heKeywords } from '@lokascript/i18n/parser/he';
18
+ * import { Parser } from '@hyperfixi/core';
19
+ *
20
+ * const parser = new Parser({ keywords: heKeywords });
21
+ * parser.parse('ב לחיצה מתג .active');
22
+ * ```
23
+ */
24
+ declare const heKeywords: KeywordProvider;
3
25
 
4
26
  /**
5
27
  * English dictionary - identity mapping since English is the canonical hyperscript language.
@@ -54,4 +76,4 @@ declare function getSupportedDirectPairs(): Array<{
54
76
  target: string;
55
77
  }>;
56
78
 
57
- export { directMappings, en, getDirectMapping, getSupportedDirectPairs, hasDirectMapping, translateWordDirect };
79
+ export { KeywordProvider, directMappings, en, getDirectMapping, getSupportedDirectPairs, hasDirectMapping, he, he as heDictionary, heKeywords, translateWordDirect };
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,27 @@
1
- export { A as AdpositionType, E as ENGLISH_COMMANDS, a as ENGLISH_KEYWORDS, G as GrammarRule, b as GrammarTransformer, c as GrammaticalMarker, K as KeywordProvider, d as KeywordProviderOptions, L as LANGUAGE_FAMILY_DEFAULTS, e as LanguageProfile, f as LocaleManager, M as MorphologyType, P as ParsedElement, g as ParsedStatement, h as PatternMatcher, i as PatternTransform, S as SemanticRole, U as UNIVERSAL_ENGLISH_KEYWORDS, j as UNIVERSAL_PATTERNS, W as WordOrder, k as ar, k as arDictionary, l as arKeywords, m as arabicProfile, n as bn, n as bnDictionary, o as bnKeywords, p as chineseProfile, q as createEnglishProvider, r as createKeywordProvider, s as de, s as deDictionary, t as deKeywords, u as detectBrowserLocale, v as englishProfile, w as es, w as esDictionary, x as esKeywords, y as fr, y as frDictionary, z as frKeywords, B as frenchProfile, C as germanProfile, D as getProfile, F as getSupportedLocales, H as grammarExamples, I as hiDictionary, J as hiKeywords, I as hindiDictionary, N as id, N as idDictionary, O as idKeywords, Q as indonesianProfile, R as insertMarkers, T as it, T as itDictionary, V as itKeywords, X as ja, X as jaDictionary, Y as jaKeywords, Z as japaneseProfile, _ as joinTokens, $ as ko, $ as koDictionary, a0 as koKeywords, a1 as koreanProfile, a2 as ms, a2 as msDictionary, a3 as msKeywords, a4 as parseStatement, a5 as pl, a5 as plDictionary, a6 as plKeywords, a7 as portugueseProfile, a8 as profiles, a9 as pt, a9 as ptDictionary, aa as ptKeywords, ab as qu, ab as quDictionary, ac as quKeywords, ad as quechuaProfile, ae as reorderRoles, af as ruDictionary, ag as ruKeywords, af as russianDictionary, ah as spanishProfile, ai as sw, ai as swDictionary, aj as swKeywords, ak as swahiliProfile, al as th, al as thDictionary, am as thKeywords, an as tl, an as tlDictionary, ao as tlKeywords, ap as toEnglish, aq as toLocale, ar as tr, ar as trDictionary, as as trKeywords, at as transformStatement, au as translate, av as turkishProfile, aw as ukDictionary, ax as ukKeywords, aw as ukrainianDictionary, ay as vi, ay as viDictionary, az as viKeywords, aA as zh, aA as zhDictionary, aB as zhKeywords } from './transformer-B0zy-kti.js';
2
- import { D as Dictionary } from './types-BYtpqGq3.js';
1
+ import { K as KeywordProvider } from './transformer-BLv389qz.js';
2
+ export { A as AdpositionType, E as ENGLISH_COMMANDS, a as ENGLISH_KEYWORDS, G as GrammarRule, b as GrammarTransformer, c as GrammaticalMarker, d as KeywordProviderOptions, L as LANGUAGE_FAMILY_DEFAULTS, e as LanguageProfile, f as LocaleManager, M as MorphologyType, P as ParsedElement, g as ParsedStatement, h as PatternMatcher, i as PatternTransform, S as SemanticRole, U as UNIVERSAL_ENGLISH_KEYWORDS, j as UNIVERSAL_PATTERNS, W as WordOrder, k as ar, k as arDictionary, l as arKeywords, m as arabicProfile, n as bn, n as bnDictionary, o as bnKeywords, p as chineseProfile, q as createEnglishProvider, r as createKeywordProvider, s as de, s as deDictionary, t as deKeywords, u as detectBrowserLocale, v as englishProfile, w as es, w as esDictionary, x as esKeywords, z as fr, z as frDictionary, B as frKeywords, C as frenchProfile, D as germanProfile, F as getProfile, H as getSupportedLocales, y as grammarExamples, I as hebrewProfile, N as hiDictionary, J as hiKeywords, N as hindiDictionary, O as id, O as idDictionary, Q as idKeywords, R as indonesianProfile, T as insertMarkers, V as it, V as itDictionary, X as itKeywords, Y as ja, Y as jaDictionary, Z as jaKeywords, _ as japaneseProfile, $ as joinTokens, a0 as ko, a0 as koDictionary, a1 as koKeywords, a2 as koreanProfile, a3 as ms, a3 as msDictionary, a4 as msKeywords, a5 as parseStatement, a6 as pl, a6 as plDictionary, a7 as plKeywords, a8 as portugueseProfile, a9 as profiles, aa as pt, aa as ptDictionary, ab as ptKeywords, ac as qu, ac as quDictionary, ad as quKeywords, ae as quechuaProfile, af as reorderRoles, ah as ruDictionary, ag as ruKeywords, ah as russianDictionary, ai as spanishProfile, aj as sw, aj as swDictionary, ak as swKeywords, al as swahiliProfile, am as th, am as thDictionary, an as thKeywords, ao as tl, ao as tlDictionary, ap as tlKeywords, aq as toEnglish, ar as toLocale, as as tr, as as trDictionary, at as trKeywords, au as transformStatement, av as translate, aw as turkishProfile, ay as ukDictionary, ax as ukKeywords, ay as ukrainianDictionary, az as vi, az as viDictionary, aA as viKeywords, aB as zh, aB as zhDictionary, aC as zhKeywords } from './transformer-BLv389qz.js';
3
+ import { a as Dictionary } from './types-BcALAO6h.js';
4
+
5
+ declare const he: Dictionary;
6
+
7
+ /**
8
+ * Hebrew keyword provider for the hyperscript parser.
9
+ *
10
+ * Enables parsing hyperscript written in Hebrew (RTL, SVO):
11
+ * - `ב לחיצה מתג .active` → parses as `on click toggle .active`
12
+ *
13
+ * English keywords are also accepted (mixed mode).
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { heKeywords } from '@lokascript/i18n/parser/he';
18
+ * import { Parser } from '@hyperfixi/core';
19
+ *
20
+ * const parser = new Parser({ keywords: heKeywords });
21
+ * parser.parse('ב לחיצה מתג .active');
22
+ * ```
23
+ */
24
+ declare const heKeywords: KeywordProvider;
3
25
 
4
26
  /**
5
27
  * English dictionary - identity mapping since English is the canonical hyperscript language.
@@ -54,4 +76,4 @@ declare function getSupportedDirectPairs(): Array<{
54
76
  target: string;
55
77
  }>;
56
78
 
57
- export { directMappings, en, getDirectMapping, getSupportedDirectPairs, hasDirectMapping, translateWordDirect };
79
+ export { KeywordProvider, directMappings, en, getDirectMapping, getSupportedDirectPairs, hasDirectMapping, he, he as heDictionary, heKeywords, translateWordDirect };