@lokascript/i18n 1.2.1 → 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,5 +1,11 @@
1
- export { D as AdpositionType, E as ENGLISH_COMMANDS, d as ENGLISH_KEYWORDS, H as GrammarRule, ac as GrammarTransformer, G as GrammaticalMarker, K as KeywordProvider, a as KeywordProviderOptions, Q as LANGUAGE_FAMILY_DEFAULTS, F as LanguageProfile, L as LocaleManager, M as MorphologyType, N as ParsedElement, J as ParsedStatement, P as PatternMatcher, I as PatternTransform, S as SemanticRole, U as UNIVERSAL_ENGLISH_KEYWORDS, O as UNIVERSAL_PATTERNS, W as WordOrder, n as ar, n as arDictionary, m as arKeywords, a3 as arabicProfile, a2 as chineseProfile, b as createEnglishProvider, c as createKeywordProvider, l as de, l as deDictionary, k as deKeywords, C as detectBrowserLocale, $ as englishProfile, f as es, f as esDictionary, e as esKeywords, i as fr, i as frDictionary, h as frKeywords, a7 as frenchProfile, a6 as germanProfile, Z as getProfile, _ as getSupportedLocales, ah as grammarExamples, u as id, u as idDictionary, s as idKeywords, a9 as indonesianProfile, T as insertMarkers, g as ja, g as jaDictionary, j as jaKeywords, a0 as japaneseProfile, V as joinTokens, p as ko, p as koDictionary, o as koKeywords, a1 as koreanProfile, ad as parseStatement, a8 as portugueseProfile, Y as profiles, B as pt, B as ptDictionary, A as ptKeywords, w as qu, w as quDictionary, v as quKeywords, aa as quechuaProfile, R as reorderRoles, a5 as spanishProfile, y as sw, y as swDictionary, x as swKeywords, ab as swahiliProfile, af as toEnglish, ae as toLocale, r as tr, r as trDictionary, t as trKeywords, X as transformStatement, ag as translate, a4 as turkishProfile, q as zh, q as zhDictionary, z as zhKeywords } from './transformer-D8MM2_rz.cjs';
2
- import './types-naTJIIaT.cjs';
1
+ export { a1 as AdpositionType, E as ENGLISH_COMMANDS, d as ENGLISH_KEYWORDS, a5 as GrammarRule, aw as GrammarTransformer, a3 as GrammaticalMarker, K as KeywordProvider, a as KeywordProviderOptions, ab as LANGUAGE_FAMILY_DEFAULTS, a4 as LanguageProfile, Z as LocaleManager, a2 as MorphologyType, a9 as ParsedElement, a8 as ParsedStatement, a6 as PatternMatcher, a7 as PatternTransform, $ as SemanticRole, U as UNIVERSAL_ENGLISH_KEYWORDS, aa as UNIVERSAL_PATTERNS, a0 as WordOrder, n as ar, n as arDictionary, m as arKeywords, an as arabicProfile, R as bn, R as bnDictionary, Q as bnKeywords, am as chineseProfile, b as createEnglishProvider, c as createKeywordProvider, l as de, l as deDictionary, k as deKeywords, _ as detectBrowserLocale, aj as englishProfile, f as es, f as esDictionary, e as esKeywords, i as fr, i as frDictionary, h as frKeywords, ar as frenchProfile, aq as germanProfile, ah as getProfile, ai as getSupportedLocales, aB as grammarExamples, P as hiDictionary, O as hiKeywords, P as hindiDictionary, u as id, u as idDictionary, s as idKeywords, at as indonesianProfile, ad as insertMarkers, D as it, D as itDictionary, C as itKeywords, g as ja, g as jaDictionary, j as jaKeywords, ak as japaneseProfile, ae as joinTokens, p as ko, p as koDictionary, o as koKeywords, al as koreanProfile, W as ms, W as msDictionary, V as msKeywords, ax as parseStatement, I as pl, I as plDictionary, H as plKeywords, as as portugueseProfile, ag as profiles, B as pt, B as ptDictionary, A as ptKeywords, w as qu, w as quDictionary, v as quKeywords, au as quechuaProfile, ac as reorderRoles, L as ruDictionary, J as ruKeywords, L as russianDictionary, ap as spanishProfile, y as sw, y as swDictionary, x as swKeywords, av as swahiliProfile, T as th, T as thDictionary, S as thKeywords, Y as tl, Y as tlDictionary, X as tlKeywords, az as toEnglish, ay as toLocale, r as tr, r as trDictionary, t as trKeywords, af as transformStatement, aA as translate, ao as turkishProfile, N as ukDictionary, M as ukKeywords, N as ukrainianDictionary, G as vi, G as viDictionary, F as viKeywords, q as zh, q as zhDictionary, z as zhKeywords } from './transformer-kXwlqa5b.cjs';
2
+ import { D as Dictionary } from './types-naTJIIaT.cjs';
3
+
4
+ /**
5
+ * English dictionary - identity mapping since English is the canonical hyperscript language.
6
+ * This exists primarily for symmetry in translation operations (e.g., en -> es).
7
+ */
8
+ declare const en: Dictionary;
3
9
 
4
10
  /**
5
11
  * Direct Language-Pair Mappings
@@ -48,4 +54,4 @@ declare function getSupportedDirectPairs(): Array<{
48
54
  target: string;
49
55
  }>;
50
56
 
51
- export { directMappings, getDirectMapping, getSupportedDirectPairs, hasDirectMapping, translateWordDirect };
57
+ export { directMappings, en, getDirectMapping, getSupportedDirectPairs, hasDirectMapping, translateWordDirect };
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,11 @@
1
- export { D as AdpositionType, E as ENGLISH_COMMANDS, d as ENGLISH_KEYWORDS, H as GrammarRule, ac as GrammarTransformer, G as GrammaticalMarker, K as KeywordProvider, a as KeywordProviderOptions, Q as LANGUAGE_FAMILY_DEFAULTS, F as LanguageProfile, L as LocaleManager, M as MorphologyType, N as ParsedElement, J as ParsedStatement, P as PatternMatcher, I as PatternTransform, S as SemanticRole, U as UNIVERSAL_ENGLISH_KEYWORDS, O as UNIVERSAL_PATTERNS, W as WordOrder, n as ar, n as arDictionary, m as arKeywords, a3 as arabicProfile, a2 as chineseProfile, b as createEnglishProvider, c as createKeywordProvider, l as de, l as deDictionary, k as deKeywords, C as detectBrowserLocale, $ as englishProfile, f as es, f as esDictionary, e as esKeywords, i as fr, i as frDictionary, h as frKeywords, a7 as frenchProfile, a6 as germanProfile, Z as getProfile, _ as getSupportedLocales, ah as grammarExamples, u as id, u as idDictionary, s as idKeywords, a9 as indonesianProfile, T as insertMarkers, g as ja, g as jaDictionary, j as jaKeywords, a0 as japaneseProfile, V as joinTokens, p as ko, p as koDictionary, o as koKeywords, a1 as koreanProfile, ad as parseStatement, a8 as portugueseProfile, Y as profiles, B as pt, B as ptDictionary, A as ptKeywords, w as qu, w as quDictionary, v as quKeywords, aa as quechuaProfile, R as reorderRoles, a5 as spanishProfile, y as sw, y as swDictionary, x as swKeywords, ab as swahiliProfile, af as toEnglish, ae as toLocale, r as tr, r as trDictionary, t as trKeywords, X as transformStatement, ag as translate, a4 as turkishProfile, q as zh, q as zhDictionary, z as zhKeywords } from './transformer-BBKJJ2vd.js';
2
- import './types-naTJIIaT.js';
1
+ export { a1 as AdpositionType, E as ENGLISH_COMMANDS, d as ENGLISH_KEYWORDS, a5 as GrammarRule, aw as GrammarTransformer, a3 as GrammaticalMarker, K as KeywordProvider, a as KeywordProviderOptions, ab as LANGUAGE_FAMILY_DEFAULTS, a4 as LanguageProfile, Z as LocaleManager, a2 as MorphologyType, a9 as ParsedElement, a8 as ParsedStatement, a6 as PatternMatcher, a7 as PatternTransform, $ as SemanticRole, U as UNIVERSAL_ENGLISH_KEYWORDS, aa as UNIVERSAL_PATTERNS, a0 as WordOrder, n as ar, n as arDictionary, m as arKeywords, an as arabicProfile, R as bn, R as bnDictionary, Q as bnKeywords, am as chineseProfile, b as createEnglishProvider, c as createKeywordProvider, l as de, l as deDictionary, k as deKeywords, _ as detectBrowserLocale, aj as englishProfile, f as es, f as esDictionary, e as esKeywords, i as fr, i as frDictionary, h as frKeywords, ar as frenchProfile, aq as germanProfile, ah as getProfile, ai as getSupportedLocales, aB as grammarExamples, P as hiDictionary, O as hiKeywords, P as hindiDictionary, u as id, u as idDictionary, s as idKeywords, at as indonesianProfile, ad as insertMarkers, D as it, D as itDictionary, C as itKeywords, g as ja, g as jaDictionary, j as jaKeywords, ak as japaneseProfile, ae as joinTokens, p as ko, p as koDictionary, o as koKeywords, al as koreanProfile, W as ms, W as msDictionary, V as msKeywords, ax as parseStatement, I as pl, I as plDictionary, H as plKeywords, as as portugueseProfile, ag as profiles, B as pt, B as ptDictionary, A as ptKeywords, w as qu, w as quDictionary, v as quKeywords, au as quechuaProfile, ac as reorderRoles, L as ruDictionary, J as ruKeywords, L as russianDictionary, ap as spanishProfile, y as sw, y as swDictionary, x as swKeywords, av as swahiliProfile, T as th, T as thDictionary, S as thKeywords, Y as tl, Y as tlDictionary, X as tlKeywords, az as toEnglish, ay as toLocale, r as tr, r as trDictionary, t as trKeywords, af as transformStatement, aA as translate, ao as turkishProfile, N as ukDictionary, M as ukKeywords, N as ukrainianDictionary, G as vi, G as viDictionary, F as viKeywords, q as zh, q as zhDictionary, z as zhKeywords } from './transformer-DN_HqdDB.js';
2
+ import { D as Dictionary } from './types-naTJIIaT.js';
3
+
4
+ /**
5
+ * English dictionary - identity mapping since English is the canonical hyperscript language.
6
+ * This exists primarily for symmetry in translation operations (e.g., en -> es).
7
+ */
8
+ declare const en: Dictionary;
3
9
 
4
10
  /**
5
11
  * Direct Language-Pair Mappings
@@ -48,4 +54,4 @@ declare function getSupportedDirectPairs(): Array<{
48
54
  target: string;
49
55
  }>;
50
56
 
51
- export { directMappings, getDirectMapping, getSupportedDirectPairs, hasDirectMapping, translateWordDirect };
57
+ export { directMappings, en, getDirectMapping, getSupportedDirectPairs, hasDirectMapping, translateWordDirect };