@lokascript/i18n 2.7.2 → 2.9.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 (61) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +1 -1
  3. package/dist/browser.cjs +649 -180
  4. package/dist/browser.cjs.map +1 -1
  5. package/dist/browser.d.cts +2 -2
  6. package/dist/browser.d.ts +2 -2
  7. package/dist/browser.js +649 -180
  8. package/dist/browser.js.map +1 -1
  9. package/dist/dictionaries/index.cjs +370 -174
  10. package/dist/dictionaries/index.cjs.map +1 -1
  11. package/dist/dictionaries/index.js +370 -174
  12. package/dist/dictionaries/index.js.map +1 -1
  13. package/dist/index.cjs +649 -180
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +1 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +649 -180
  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 +678 -175
  22. package/dist/lokascript-i18n.mjs.map +1 -1
  23. package/dist/plugins/vite.cjs +370 -174
  24. package/dist/plugins/vite.cjs.map +1 -1
  25. package/dist/plugins/vite.js +370 -174
  26. package/dist/plugins/vite.js.map +1 -1
  27. package/dist/plugins/webpack.cjs +370 -174
  28. package/dist/plugins/webpack.cjs.map +1 -1
  29. package/dist/plugins/webpack.js +370 -174
  30. package/dist/plugins/webpack.js.map +1 -1
  31. package/dist/{transformer-DM7iplCU.d.cts → transformer--W46PGaW.d.cts} +8 -0
  32. package/dist/{transformer-BA8YX9u1.d.ts → transformer-FU06J6kG.d.ts} +8 -0
  33. package/package.json +9 -10
  34. package/src/dictionaries/ar.ts +20 -15
  35. package/src/dictionaries/bn.ts +10 -5
  36. package/src/dictionaries/de.ts +20 -8
  37. package/src/dictionaries/es.ts +10 -5
  38. package/src/dictionaries/fr.ts +15 -6
  39. package/src/dictionaries/he.ts +4 -0
  40. package/src/dictionaries/hi.ts +3 -2
  41. package/src/dictionaries/id.ts +31 -16
  42. package/src/dictionaries/it.ts +11 -4
  43. package/src/dictionaries/ja.ts +23 -15
  44. package/src/dictionaries/ko.ts +10 -5
  45. package/src/dictionaries/ms.ts +4 -1
  46. package/src/dictionaries/pl.ts +12 -5
  47. package/src/dictionaries/pt.ts +10 -5
  48. package/src/dictionaries/qu.ts +30 -19
  49. package/src/dictionaries/ru.ts +5 -2
  50. package/src/dictionaries/sw.ts +29 -14
  51. package/src/dictionaries/th.ts +5 -2
  52. package/src/dictionaries/tl.ts +4 -1
  53. package/src/dictionaries/tr.ts +24 -16
  54. package/src/dictionaries/uk.ts +5 -2
  55. package/src/dictionaries/vi.ts +23 -17
  56. package/src/dictionaries/zh.ts +24 -9
  57. package/src/grammar/grammar.test.ts +152 -0
  58. package/src/grammar/profiles/index.ts +316 -1
  59. package/src/grammar/transformer.ts +64 -1
  60. package/src/new-languages.test.ts +9 -3
  61. package/src/positional-keyword-drift.test.ts +6 -19
package/CHANGELOG.md ADDED
@@ -0,0 +1,51 @@
1
+ # Changelog
2
+
3
+ All notable changes to @lokascript/i18n will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2025-01-19
9
+
10
+ ### Added
11
+
12
+ - Grammar transformation engine for natural word order in 13 languages
13
+ - Language profiles with word order rules (SVO, SOV, VSO)
14
+ - Semantic role markers (destination, source, patient, style, instrument, manner)
15
+ - Support for agglutinative languages with join tokens (Turkish: -i, Japanese: を, Korean: 을/를)
16
+ - Dictionary validation system with coverage reports
17
+ - Runtime locale switching with automatic detection
18
+ - SSR integration with server-side locale detection
19
+ - CLDR-compliant pluralization rules for complex languages
20
+ - Locale-aware formatting (numbers, dates, currency, units)
21
+ - Vite and Webpack plugin integration
22
+ - Language detection from hyperscript code content
23
+ - Comprehensive test suite (424+ tests passing)
24
+
25
+ ### Supported Languages
26
+
27
+ - English (SVO), Spanish (SVO), French (SVO), German (SVO/V2), Portuguese (SVO)
28
+ - Japanese (SOV), Korean (SOV), Turkish (SOV)
29
+ - Arabic (VSO)
30
+ - Chinese (SVO), Indonesian (SVO), Quechua (SOV), Swahili (SVO)
31
+
32
+ ### Features
33
+
34
+ - Transform hyperscript to match native language grammar
35
+ - Handle possessive markers and case systems
36
+ - Support for different grammatical structures (prepositional vs postpositional)
37
+ - Bidirectional text support (Arabic, Hebrew)
38
+ - Conflict resolution with priority-based keyword mapping
39
+ - Translation validation with detailed error reporting
40
+
41
+ ### Breaking Changes from 0.x
42
+
43
+ - Grammar transformer API standardized
44
+ - Language profile structure reorganized
45
+ - Plugin configuration format updated
46
+
47
+ ### Notes
48
+
49
+ - This is the first stable release after extensive linguistic validation
50
+ - Grammar transformations preserve semantic meaning across languages
51
+ - All language profiles include native speaker review where available
package/README.md CHANGED
@@ -10,7 +10,7 @@ npm install @lokascript/i18n
10
10
 
11
11
  ## Features
12
12
 
13
- - **🌍 Multi-language Support**: Built-in dictionaries for 13 languages (English, Spanish, French, German, Japanese, Korean, Chinese, Arabic, Turkish, Portuguese, Indonesian, Quechua, Swahili)
13
+ - **🌍 Multi-language Support**: Built-in dictionaries for 24 languages (Arabic, Bengali, Chinese, English, French, German, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Malay, Polish, Portuguese, Quechua, Russian, Spanish, Swahili, Tagalog, Thai, Turkish, Ukrainian, Vietnamese)
14
14
  - **🔄 Runtime Locale Switching**: Dynamic language switching in browser environments with automatic detection
15
15
  - **⚡ SSR Integration**: Server-side rendering with locale detection, SEO optimization, and hydration support
16
16
  - **📊 Pluralization**: CLDR-compliant pluralization rules for complex languages (Russian, Arabic, etc.)