@lokascript/i18n 1.3.0 → 2.1.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 (92) 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 +30 -81
  10. package/dist/dictionaries/index.d.ts +30 -81
  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 +38 -38
  16. package/dist/index.d.ts +38 -38
  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-B6NgN3JQ.d.ts} +108 -15
  32. package/dist/{transformer-D8MM2_rz.d.cts → transformer-DQqxl6hb.d.cts} +108 -15
  33. package/dist/{types-naTJIIaT.d.cts → types-BYtpqGq3.d.cts} +1 -1
  34. package/dist/{types-naTJIIaT.d.ts → types-BYtpqGq3.d.ts} +1 -1
  35. package/package.json +8 -7
  36. package/src/browser.ts +22 -1
  37. package/src/dictionaries/ar.ts +0 -2
  38. package/src/dictionaries/de.ts +0 -2
  39. package/src/dictionaries/derive.ts +0 -2
  40. package/src/dictionaries/en.ts +0 -2
  41. package/src/dictionaries/es.ts +0 -2
  42. package/src/dictionaries/fr.ts +0 -2
  43. package/src/dictionaries/hi.ts +0 -2
  44. package/src/dictionaries/id.ts +0 -2
  45. package/src/dictionaries/index.ts +79 -163
  46. package/src/dictionaries/it.ts +0 -2
  47. package/src/dictionaries/ja.ts +0 -2
  48. package/src/dictionaries/ko.ts +0 -2
  49. package/src/dictionaries/ms.ts +0 -2
  50. package/src/dictionaries/pl.ts +0 -2
  51. package/src/dictionaries/pt.ts +0 -2
  52. package/src/dictionaries/qu.ts +0 -2
  53. package/src/dictionaries/ru.ts +0 -2
  54. package/src/dictionaries/sw.ts +0 -2
  55. package/src/dictionaries/tl.ts +0 -2
  56. package/src/dictionaries/tr.ts +0 -2
  57. package/src/dictionaries/uk.ts +0 -2
  58. package/src/dictionaries/vi.ts +0 -2
  59. package/src/dictionaries/zh.ts +0 -2
  60. package/src/grammar/direct-mappings.ts +0 -2
  61. package/src/grammar/grammar.test.ts +98 -0
  62. package/src/grammar/index.ts +9 -0
  63. package/src/grammar/transformer.ts +125 -73
  64. package/src/index.ts +30 -0
  65. package/src/parser/ar.ts +1 -1
  66. package/src/parser/bn.ts +9 -0
  67. package/src/parser/de.ts +1 -1
  68. package/src/parser/es.ts +1 -1
  69. package/src/parser/fr.ts +1 -1
  70. package/src/parser/hi.ts +9 -0
  71. package/src/parser/id.ts +1 -1
  72. package/src/parser/index.ts +10 -0
  73. package/src/parser/it.ts +9 -0
  74. package/src/parser/ja.ts +1 -1
  75. package/src/parser/ko.ts +1 -1
  76. package/src/parser/locale-manager.ts +1 -1
  77. package/src/parser/ms.ts +9 -0
  78. package/src/parser/pl.ts +9 -0
  79. package/src/parser/pt.ts +1 -1
  80. package/src/parser/qu.ts +1 -1
  81. package/src/parser/ru.ts +9 -0
  82. package/src/parser/sw.ts +1 -1
  83. package/src/parser/th.ts +9 -0
  84. package/src/parser/tl.ts +9 -0
  85. package/src/parser/tr.ts +1 -1
  86. package/src/parser/uk.ts +9 -0
  87. package/src/parser/vi.ts +9 -0
  88. package/src/parser/zh.ts +1 -1
  89. package/src/runtime.test.ts +152 -0
  90. package/src/runtime.ts +32 -13
  91. package/src/utils/locale.test.ts +108 -0
  92. 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 { 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-DQqxl6hb.cjs';
2
+ import { D as Dictionary } from './types-BYtpqGq3.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 { 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-B6NgN3JQ.js';
2
+ import { D as Dictionary } from './types-BYtpqGq3.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 };