@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.
- package/dist/browser.cjs +3625 -3581
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +9 -3
- package/dist/browser.d.ts +9 -3
- package/dist/browser.js +3595 -3582
- package/dist/browser.js.map +1 -1
- package/dist/dictionaries/index.cjs +0 -44
- package/dist/dictionaries/index.cjs.map +1 -1
- package/dist/dictionaries/index.d.cts +30 -81
- package/dist/dictionaries/index.d.ts +30 -81
- package/dist/dictionaries/index.js +0 -44
- package/dist/dictionaries/index.js.map +1 -1
- package/dist/index.cjs +7605 -7544
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -38
- package/dist/index.d.ts +38 -38
- package/dist/index.js +7576 -7545
- package/dist/index.js.map +1 -1
- package/dist/lokascript-i18n.min.js +1 -1
- package/dist/lokascript-i18n.min.js.map +1 -1
- package/dist/lokascript-i18n.mjs +3792 -3813
- package/dist/lokascript-i18n.mjs.map +1 -1
- package/dist/plugins/vite.cjs +0 -42
- package/dist/plugins/vite.cjs.map +1 -1
- package/dist/plugins/vite.js +0 -42
- package/dist/plugins/vite.js.map +1 -1
- package/dist/plugins/webpack.cjs +0 -42
- package/dist/plugins/webpack.cjs.map +1 -1
- package/dist/plugins/webpack.js +0 -42
- package/dist/plugins/webpack.js.map +1 -1
- package/dist/{transformer-BBKJJ2vd.d.ts → transformer-B6NgN3JQ.d.ts} +108 -15
- package/dist/{transformer-D8MM2_rz.d.cts → transformer-DQqxl6hb.d.cts} +108 -15
- package/dist/{types-naTJIIaT.d.cts → types-BYtpqGq3.d.cts} +1 -1
- package/dist/{types-naTJIIaT.d.ts → types-BYtpqGq3.d.ts} +1 -1
- package/package.json +8 -7
- package/src/browser.ts +22 -1
- package/src/dictionaries/ar.ts +0 -2
- package/src/dictionaries/de.ts +0 -2
- package/src/dictionaries/derive.ts +0 -2
- package/src/dictionaries/en.ts +0 -2
- package/src/dictionaries/es.ts +0 -2
- package/src/dictionaries/fr.ts +0 -2
- package/src/dictionaries/hi.ts +0 -2
- package/src/dictionaries/id.ts +0 -2
- package/src/dictionaries/index.ts +79 -163
- package/src/dictionaries/it.ts +0 -2
- package/src/dictionaries/ja.ts +0 -2
- package/src/dictionaries/ko.ts +0 -2
- package/src/dictionaries/ms.ts +0 -2
- package/src/dictionaries/pl.ts +0 -2
- package/src/dictionaries/pt.ts +0 -2
- package/src/dictionaries/qu.ts +0 -2
- package/src/dictionaries/ru.ts +0 -2
- package/src/dictionaries/sw.ts +0 -2
- package/src/dictionaries/tl.ts +0 -2
- package/src/dictionaries/tr.ts +0 -2
- package/src/dictionaries/uk.ts +0 -2
- package/src/dictionaries/vi.ts +0 -2
- package/src/dictionaries/zh.ts +0 -2
- package/src/grammar/direct-mappings.ts +0 -2
- package/src/grammar/grammar.test.ts +98 -0
- package/src/grammar/index.ts +9 -0
- package/src/grammar/transformer.ts +125 -73
- package/src/index.ts +30 -0
- package/src/parser/ar.ts +1 -1
- package/src/parser/bn.ts +9 -0
- package/src/parser/de.ts +1 -1
- package/src/parser/es.ts +1 -1
- package/src/parser/fr.ts +1 -1
- package/src/parser/hi.ts +9 -0
- package/src/parser/id.ts +1 -1
- package/src/parser/index.ts +10 -0
- package/src/parser/it.ts +9 -0
- package/src/parser/ja.ts +1 -1
- package/src/parser/ko.ts +1 -1
- package/src/parser/locale-manager.ts +1 -1
- package/src/parser/ms.ts +9 -0
- package/src/parser/pl.ts +9 -0
- package/src/parser/pt.ts +1 -1
- package/src/parser/qu.ts +1 -1
- package/src/parser/ru.ts +9 -0
- package/src/parser/sw.ts +1 -1
- package/src/parser/th.ts +9 -0
- package/src/parser/tl.ts +9 -0
- package/src/parser/tr.ts +1 -1
- package/src/parser/uk.ts +9 -0
- package/src/parser/vi.ts +9 -0
- package/src/parser/zh.ts +1 -1
- package/src/runtime.test.ts +152 -0
- package/src/runtime.ts +32 -13
- package/src/utils/locale.test.ts +108 -0
- package/src/utils/locale.ts +19 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Dictionary } from './types-
|
|
1
|
+
import { D as Dictionary } from './types-BYtpqGq3.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* KeywordProvider interface for locale-aware parsing.
|
|
@@ -369,7 +369,7 @@ declare const es: Dictionary;
|
|
|
369
369
|
* @example
|
|
370
370
|
* ```typescript
|
|
371
371
|
* import { esKeywords } from '@lokascript/i18n/parser/es';
|
|
372
|
-
* import { Parser } from '@
|
|
372
|
+
* import { Parser } from '@hyperfixi/core';
|
|
373
373
|
*
|
|
374
374
|
* const parser = new Parser({ keywords: esKeywords });
|
|
375
375
|
* parser.parse('en clic alternar .active');
|
|
@@ -397,7 +397,7 @@ declare const ja: Dictionary;
|
|
|
397
397
|
* @example
|
|
398
398
|
* ```typescript
|
|
399
399
|
* import { jaKeywords } from '@lokascript/i18n/parser/ja';
|
|
400
|
-
* import { Parser } from '@
|
|
400
|
+
* import { Parser } from '@hyperfixi/core';
|
|
401
401
|
*
|
|
402
402
|
* const parser = new Parser({ keywords: jaKeywords });
|
|
403
403
|
* parser.parse('クリック で 切り替え .active');
|
|
@@ -420,7 +420,7 @@ declare const fr: Dictionary;
|
|
|
420
420
|
* @example
|
|
421
421
|
* ```typescript
|
|
422
422
|
* import { frKeywords } from '@lokascript/i18n/parser/fr';
|
|
423
|
-
* import { Parser } from '@
|
|
423
|
+
* import { Parser } from '@hyperfixi/core';
|
|
424
424
|
*
|
|
425
425
|
* const parser = new Parser({ keywords: frKeywords });
|
|
426
426
|
* parser.parse('sur clic basculer .active');
|
|
@@ -448,7 +448,7 @@ declare const de: Dictionary;
|
|
|
448
448
|
* @example
|
|
449
449
|
* ```typescript
|
|
450
450
|
* import { deKeywords } from '@lokascript/i18n/parser/de';
|
|
451
|
-
* import { Parser } from '@
|
|
451
|
+
* import { Parser } from '@hyperfixi/core';
|
|
452
452
|
*
|
|
453
453
|
* const parser = new Parser({ keywords: deKeywords });
|
|
454
454
|
* parser.parse('bei klick umschalten .active');
|
|
@@ -480,7 +480,7 @@ declare const ar: Dictionary;
|
|
|
480
480
|
* @example
|
|
481
481
|
* ```typescript
|
|
482
482
|
* import { arKeywords } from '@lokascript/i18n/parser/ar';
|
|
483
|
-
* import { Parser } from '@
|
|
483
|
+
* import { Parser } from '@hyperfixi/core';
|
|
484
484
|
*
|
|
485
485
|
* const parser = new Parser({ keywords: arKeywords });
|
|
486
486
|
* parser.parse('على نقر بدل .active');
|
|
@@ -509,7 +509,7 @@ declare const ko: Dictionary;
|
|
|
509
509
|
* @example
|
|
510
510
|
* ```typescript
|
|
511
511
|
* import { koKeywords } from '@lokascript/i18n/parser/ko';
|
|
512
|
-
* import { Parser } from '@
|
|
512
|
+
* import { Parser } from '@hyperfixi/core';
|
|
513
513
|
*
|
|
514
514
|
* const parser = new Parser({ keywords: koKeywords });
|
|
515
515
|
* parser.parse('에 클릭 토글 .active');
|
|
@@ -539,7 +539,7 @@ declare const zh: Dictionary;
|
|
|
539
539
|
* @example
|
|
540
540
|
* ```typescript
|
|
541
541
|
* import { zhKeywords } from '@lokascript/i18n/parser/zh';
|
|
542
|
-
* import { Parser } from '@
|
|
542
|
+
* import { Parser } from '@hyperfixi/core';
|
|
543
543
|
*
|
|
544
544
|
* const parser = new Parser({ keywords: zhKeywords });
|
|
545
545
|
* parser.parse('当 点击 切换 .active');
|
|
@@ -569,7 +569,7 @@ declare const tr: Dictionary;
|
|
|
569
569
|
* @example
|
|
570
570
|
* ```typescript
|
|
571
571
|
* import { trKeywords } from '@lokascript/i18n/parser/tr';
|
|
572
|
-
* import { Parser } from '@
|
|
572
|
+
* import { Parser } from '@hyperfixi/core';
|
|
573
573
|
*
|
|
574
574
|
* const parser = new Parser({ keywords: trKeywords });
|
|
575
575
|
* parser.parse('üzerinde tıklama değiştir .active');
|
|
@@ -595,7 +595,7 @@ declare const id: Dictionary;
|
|
|
595
595
|
* @example
|
|
596
596
|
* ```typescript
|
|
597
597
|
* import { idKeywords } from '@lokascript/i18n/parser/id';
|
|
598
|
-
* import { Parser } from '@
|
|
598
|
+
* import { Parser } from '@hyperfixi/core';
|
|
599
599
|
*
|
|
600
600
|
* const parser = new Parser({ keywords: idKeywords });
|
|
601
601
|
* parser.parse('pada klik ganti .active');
|
|
@@ -624,7 +624,7 @@ declare const qu: Dictionary;
|
|
|
624
624
|
* @example
|
|
625
625
|
* ```typescript
|
|
626
626
|
* import { quKeywords } from '@lokascript/i18n/parser/qu';
|
|
627
|
-
* import { Parser } from '@
|
|
627
|
+
* import { Parser } from '@hyperfixi/core';
|
|
628
628
|
*
|
|
629
629
|
* const parser = new Parser({ keywords: quKeywords });
|
|
630
630
|
* parser.parse('ñitiy-pi yapay #count-ta');
|
|
@@ -653,7 +653,7 @@ declare const sw: Dictionary;
|
|
|
653
653
|
* @example
|
|
654
654
|
* ```typescript
|
|
655
655
|
* import { swKeywords } from '@lokascript/i18n/parser/sw';
|
|
656
|
-
* import { Parser } from '@
|
|
656
|
+
* import { Parser } from '@hyperfixi/core';
|
|
657
657
|
*
|
|
658
658
|
* const parser = new Parser({ keywords: swKeywords });
|
|
659
659
|
* parser.parse('kwenye bonyeza badilisha .active');
|
|
@@ -686,7 +686,7 @@ declare const pt: Dictionary;
|
|
|
686
686
|
* @example
|
|
687
687
|
* ```typescript
|
|
688
688
|
* import { ptKeywords } from '@lokascript/i18n/parser/pt';
|
|
689
|
-
* import { Parser } from '@
|
|
689
|
+
* import { Parser } from '@hyperfixi/core';
|
|
690
690
|
*
|
|
691
691
|
* const parser = new Parser({ keywords: ptKeywords });
|
|
692
692
|
* parser.parse('em clique alternar .active');
|
|
@@ -694,6 +694,99 @@ declare const pt: Dictionary;
|
|
|
694
694
|
*/
|
|
695
695
|
declare const ptKeywords: KeywordProvider;
|
|
696
696
|
|
|
697
|
+
declare const it: Dictionary;
|
|
698
|
+
|
|
699
|
+
declare const itKeywords: KeywordProvider;
|
|
700
|
+
|
|
701
|
+
declare const vi: Dictionary;
|
|
702
|
+
|
|
703
|
+
declare const viKeywords: KeywordProvider;
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Polish Dictionary
|
|
707
|
+
*
|
|
708
|
+
* Polish uses IMPERATIVE verb forms for software commands
|
|
709
|
+
* (unlike most languages which use infinitive).
|
|
710
|
+
*/
|
|
711
|
+
declare const pl: Dictionary;
|
|
712
|
+
|
|
713
|
+
declare const plKeywords: KeywordProvider;
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Russian Dictionary
|
|
717
|
+
*
|
|
718
|
+
* Translations for Russian language support.
|
|
719
|
+
* Uses infinitive verbs (common in software UIs).
|
|
720
|
+
*/
|
|
721
|
+
|
|
722
|
+
declare const russianDictionary: Dictionary;
|
|
723
|
+
|
|
724
|
+
declare const ruKeywords: KeywordProvider;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Ukrainian Dictionary
|
|
728
|
+
*
|
|
729
|
+
* Translations for Ukrainian language support.
|
|
730
|
+
* Uses infinitive verbs (common in software UIs).
|
|
731
|
+
*/
|
|
732
|
+
|
|
733
|
+
declare const ukrainianDictionary: Dictionary;
|
|
734
|
+
|
|
735
|
+
declare const ukKeywords: KeywordProvider;
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Hindi Dictionary
|
|
739
|
+
*
|
|
740
|
+
* Translations for Hindi language support.
|
|
741
|
+
* Uses imperative verb forms (common in software UIs).
|
|
742
|
+
*/
|
|
743
|
+
|
|
744
|
+
declare const hindiDictionary: Dictionary;
|
|
745
|
+
|
|
746
|
+
declare const hiKeywords: KeywordProvider;
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Bengali Dictionary
|
|
750
|
+
*
|
|
751
|
+
* Bengali translations for hyperscript keywords.
|
|
752
|
+
*/
|
|
753
|
+
|
|
754
|
+
declare const bn: Dictionary;
|
|
755
|
+
|
|
756
|
+
declare const bnKeywords: KeywordProvider;
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Thai Dictionary
|
|
760
|
+
*
|
|
761
|
+
* Thai translations for hyperscript keywords.
|
|
762
|
+
*/
|
|
763
|
+
|
|
764
|
+
declare const th: Dictionary;
|
|
765
|
+
|
|
766
|
+
declare const thKeywords: KeywordProvider;
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Malay Dictionary
|
|
770
|
+
*
|
|
771
|
+
* Malay translations for hyperscript keywords.
|
|
772
|
+
* Malay is an SVO (Subject-Verb-Object) language with prepositions.
|
|
773
|
+
*/
|
|
774
|
+
|
|
775
|
+
declare const ms: Dictionary;
|
|
776
|
+
|
|
777
|
+
declare const msKeywords: KeywordProvider;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Tagalog Dictionary
|
|
781
|
+
*
|
|
782
|
+
* Tagalog translations for hyperscript keywords.
|
|
783
|
+
* Tagalog is a VSO (Verb-Subject-Object) language with rich verbal morphology.
|
|
784
|
+
*/
|
|
785
|
+
|
|
786
|
+
declare const tl: Dictionary;
|
|
787
|
+
|
|
788
|
+
declare const tlKeywords: KeywordProvider;
|
|
789
|
+
|
|
697
790
|
/**
|
|
698
791
|
* LocaleManager - Centralized locale configuration for hyperscript parsing.
|
|
699
792
|
*
|
|
@@ -806,7 +899,7 @@ declare class LocaleManager {
|
|
|
806
899
|
* @example
|
|
807
900
|
* ```typescript
|
|
808
901
|
* import { detectBrowserLocale } from '@lokascript/i18n/parser';
|
|
809
|
-
* import { Parser } from '@
|
|
902
|
+
* import { Parser } from '@hyperfixi/core';
|
|
810
903
|
*
|
|
811
904
|
* // Auto-detect and use browser locale
|
|
812
905
|
* const parser = new Parser({ keywords: detectBrowserLocale() });
|
|
@@ -919,4 +1012,4 @@ declare const examples: {
|
|
|
919
1012
|
};
|
|
920
1013
|
};
|
|
921
1014
|
|
|
922
|
-
export {
|
|
1015
|
+
export { ko as $, type AdpositionType as A, frenchProfile as B, germanProfile as C, getProfile as D, ENGLISH_COMMANDS as E, getSupportedLocales as F, type GrammarRule as G, examples as H, hindiDictionary as I, hiKeywords as J, type KeywordProvider as K, LANGUAGE_FAMILY_DEFAULTS as L, type MorphologyType as M, id as N, idKeywords as O, type ParsedElement as P, indonesianProfile as Q, insertMarkers as R, type SemanticRole as S, it as T, UNIVERSAL_ENGLISH_KEYWORDS as U, itKeywords as V, type WordOrder as W, ja as X, jaKeywords as Y, japaneseProfile as Z, joinTokens as _, ENGLISH_KEYWORDS as a, koKeywords as a0, koreanProfile as a1, ms as a2, msKeywords as a3, parseStatement as a4, pl as a5, plKeywords as a6, portugueseProfile as a7, profiles as a8, pt as a9, zh as aA, zhKeywords as aB, ptKeywords as aa, qu as ab, quKeywords as ac, quechuaProfile as ad, reorderRoles as ae, russianDictionary as af, ruKeywords as ag, spanishProfile as ah, sw as ai, swKeywords as aj, swahiliProfile as ak, th as al, thKeywords as am, tl as an, tlKeywords as ao, toEnglish as ap, toLocale as aq, tr as ar, trKeywords as as, transformStatement as at, translate as au, turkishProfile as av, ukrainianDictionary as aw, ukKeywords as ax, vi as ay, viKeywords as az, GrammarTransformer as b, type GrammaticalMarker as c, type KeywordProviderOptions as d, type LanguageProfile as e, LocaleManager as f, type ParsedStatement as g, type PatternMatcher as h, type PatternTransform as i, UNIVERSAL_PATTERNS as j, ar as k, arKeywords as l, arabicProfile as m, bn as n, bnKeywords as o, chineseProfile as p, createEnglishProvider as q, createKeywordProvider as r, de as s, deKeywords as t, detectBrowserLocale as u, englishProfile as v, es as w, esKeywords as x, fr as y, frKeywords as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Dictionary } from './types-
|
|
1
|
+
import { D as Dictionary } from './types-BYtpqGq3.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* KeywordProvider interface for locale-aware parsing.
|
|
@@ -369,7 +369,7 @@ declare const es: Dictionary;
|
|
|
369
369
|
* @example
|
|
370
370
|
* ```typescript
|
|
371
371
|
* import { esKeywords } from '@lokascript/i18n/parser/es';
|
|
372
|
-
* import { Parser } from '@
|
|
372
|
+
* import { Parser } from '@hyperfixi/core';
|
|
373
373
|
*
|
|
374
374
|
* const parser = new Parser({ keywords: esKeywords });
|
|
375
375
|
* parser.parse('en clic alternar .active');
|
|
@@ -397,7 +397,7 @@ declare const ja: Dictionary;
|
|
|
397
397
|
* @example
|
|
398
398
|
* ```typescript
|
|
399
399
|
* import { jaKeywords } from '@lokascript/i18n/parser/ja';
|
|
400
|
-
* import { Parser } from '@
|
|
400
|
+
* import { Parser } from '@hyperfixi/core';
|
|
401
401
|
*
|
|
402
402
|
* const parser = new Parser({ keywords: jaKeywords });
|
|
403
403
|
* parser.parse('クリック で 切り替え .active');
|
|
@@ -420,7 +420,7 @@ declare const fr: Dictionary;
|
|
|
420
420
|
* @example
|
|
421
421
|
* ```typescript
|
|
422
422
|
* import { frKeywords } from '@lokascript/i18n/parser/fr';
|
|
423
|
-
* import { Parser } from '@
|
|
423
|
+
* import { Parser } from '@hyperfixi/core';
|
|
424
424
|
*
|
|
425
425
|
* const parser = new Parser({ keywords: frKeywords });
|
|
426
426
|
* parser.parse('sur clic basculer .active');
|
|
@@ -448,7 +448,7 @@ declare const de: Dictionary;
|
|
|
448
448
|
* @example
|
|
449
449
|
* ```typescript
|
|
450
450
|
* import { deKeywords } from '@lokascript/i18n/parser/de';
|
|
451
|
-
* import { Parser } from '@
|
|
451
|
+
* import { Parser } from '@hyperfixi/core';
|
|
452
452
|
*
|
|
453
453
|
* const parser = new Parser({ keywords: deKeywords });
|
|
454
454
|
* parser.parse('bei klick umschalten .active');
|
|
@@ -480,7 +480,7 @@ declare const ar: Dictionary;
|
|
|
480
480
|
* @example
|
|
481
481
|
* ```typescript
|
|
482
482
|
* import { arKeywords } from '@lokascript/i18n/parser/ar';
|
|
483
|
-
* import { Parser } from '@
|
|
483
|
+
* import { Parser } from '@hyperfixi/core';
|
|
484
484
|
*
|
|
485
485
|
* const parser = new Parser({ keywords: arKeywords });
|
|
486
486
|
* parser.parse('على نقر بدل .active');
|
|
@@ -509,7 +509,7 @@ declare const ko: Dictionary;
|
|
|
509
509
|
* @example
|
|
510
510
|
* ```typescript
|
|
511
511
|
* import { koKeywords } from '@lokascript/i18n/parser/ko';
|
|
512
|
-
* import { Parser } from '@
|
|
512
|
+
* import { Parser } from '@hyperfixi/core';
|
|
513
513
|
*
|
|
514
514
|
* const parser = new Parser({ keywords: koKeywords });
|
|
515
515
|
* parser.parse('에 클릭 토글 .active');
|
|
@@ -539,7 +539,7 @@ declare const zh: Dictionary;
|
|
|
539
539
|
* @example
|
|
540
540
|
* ```typescript
|
|
541
541
|
* import { zhKeywords } from '@lokascript/i18n/parser/zh';
|
|
542
|
-
* import { Parser } from '@
|
|
542
|
+
* import { Parser } from '@hyperfixi/core';
|
|
543
543
|
*
|
|
544
544
|
* const parser = new Parser({ keywords: zhKeywords });
|
|
545
545
|
* parser.parse('当 点击 切换 .active');
|
|
@@ -569,7 +569,7 @@ declare const tr: Dictionary;
|
|
|
569
569
|
* @example
|
|
570
570
|
* ```typescript
|
|
571
571
|
* import { trKeywords } from '@lokascript/i18n/parser/tr';
|
|
572
|
-
* import { Parser } from '@
|
|
572
|
+
* import { Parser } from '@hyperfixi/core';
|
|
573
573
|
*
|
|
574
574
|
* const parser = new Parser({ keywords: trKeywords });
|
|
575
575
|
* parser.parse('üzerinde tıklama değiştir .active');
|
|
@@ -595,7 +595,7 @@ declare const id: Dictionary;
|
|
|
595
595
|
* @example
|
|
596
596
|
* ```typescript
|
|
597
597
|
* import { idKeywords } from '@lokascript/i18n/parser/id';
|
|
598
|
-
* import { Parser } from '@
|
|
598
|
+
* import { Parser } from '@hyperfixi/core';
|
|
599
599
|
*
|
|
600
600
|
* const parser = new Parser({ keywords: idKeywords });
|
|
601
601
|
* parser.parse('pada klik ganti .active');
|
|
@@ -624,7 +624,7 @@ declare const qu: Dictionary;
|
|
|
624
624
|
* @example
|
|
625
625
|
* ```typescript
|
|
626
626
|
* import { quKeywords } from '@lokascript/i18n/parser/qu';
|
|
627
|
-
* import { Parser } from '@
|
|
627
|
+
* import { Parser } from '@hyperfixi/core';
|
|
628
628
|
*
|
|
629
629
|
* const parser = new Parser({ keywords: quKeywords });
|
|
630
630
|
* parser.parse('ñitiy-pi yapay #count-ta');
|
|
@@ -653,7 +653,7 @@ declare const sw: Dictionary;
|
|
|
653
653
|
* @example
|
|
654
654
|
* ```typescript
|
|
655
655
|
* import { swKeywords } from '@lokascript/i18n/parser/sw';
|
|
656
|
-
* import { Parser } from '@
|
|
656
|
+
* import { Parser } from '@hyperfixi/core';
|
|
657
657
|
*
|
|
658
658
|
* const parser = new Parser({ keywords: swKeywords });
|
|
659
659
|
* parser.parse('kwenye bonyeza badilisha .active');
|
|
@@ -686,7 +686,7 @@ declare const pt: Dictionary;
|
|
|
686
686
|
* @example
|
|
687
687
|
* ```typescript
|
|
688
688
|
* import { ptKeywords } from '@lokascript/i18n/parser/pt';
|
|
689
|
-
* import { Parser } from '@
|
|
689
|
+
* import { Parser } from '@hyperfixi/core';
|
|
690
690
|
*
|
|
691
691
|
* const parser = new Parser({ keywords: ptKeywords });
|
|
692
692
|
* parser.parse('em clique alternar .active');
|
|
@@ -694,6 +694,99 @@ declare const pt: Dictionary;
|
|
|
694
694
|
*/
|
|
695
695
|
declare const ptKeywords: KeywordProvider;
|
|
696
696
|
|
|
697
|
+
declare const it: Dictionary;
|
|
698
|
+
|
|
699
|
+
declare const itKeywords: KeywordProvider;
|
|
700
|
+
|
|
701
|
+
declare const vi: Dictionary;
|
|
702
|
+
|
|
703
|
+
declare const viKeywords: KeywordProvider;
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Polish Dictionary
|
|
707
|
+
*
|
|
708
|
+
* Polish uses IMPERATIVE verb forms for software commands
|
|
709
|
+
* (unlike most languages which use infinitive).
|
|
710
|
+
*/
|
|
711
|
+
declare const pl: Dictionary;
|
|
712
|
+
|
|
713
|
+
declare const plKeywords: KeywordProvider;
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Russian Dictionary
|
|
717
|
+
*
|
|
718
|
+
* Translations for Russian language support.
|
|
719
|
+
* Uses infinitive verbs (common in software UIs).
|
|
720
|
+
*/
|
|
721
|
+
|
|
722
|
+
declare const russianDictionary: Dictionary;
|
|
723
|
+
|
|
724
|
+
declare const ruKeywords: KeywordProvider;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Ukrainian Dictionary
|
|
728
|
+
*
|
|
729
|
+
* Translations for Ukrainian language support.
|
|
730
|
+
* Uses infinitive verbs (common in software UIs).
|
|
731
|
+
*/
|
|
732
|
+
|
|
733
|
+
declare const ukrainianDictionary: Dictionary;
|
|
734
|
+
|
|
735
|
+
declare const ukKeywords: KeywordProvider;
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Hindi Dictionary
|
|
739
|
+
*
|
|
740
|
+
* Translations for Hindi language support.
|
|
741
|
+
* Uses imperative verb forms (common in software UIs).
|
|
742
|
+
*/
|
|
743
|
+
|
|
744
|
+
declare const hindiDictionary: Dictionary;
|
|
745
|
+
|
|
746
|
+
declare const hiKeywords: KeywordProvider;
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Bengali Dictionary
|
|
750
|
+
*
|
|
751
|
+
* Bengali translations for hyperscript keywords.
|
|
752
|
+
*/
|
|
753
|
+
|
|
754
|
+
declare const bn: Dictionary;
|
|
755
|
+
|
|
756
|
+
declare const bnKeywords: KeywordProvider;
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Thai Dictionary
|
|
760
|
+
*
|
|
761
|
+
* Thai translations for hyperscript keywords.
|
|
762
|
+
*/
|
|
763
|
+
|
|
764
|
+
declare const th: Dictionary;
|
|
765
|
+
|
|
766
|
+
declare const thKeywords: KeywordProvider;
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Malay Dictionary
|
|
770
|
+
*
|
|
771
|
+
* Malay translations for hyperscript keywords.
|
|
772
|
+
* Malay is an SVO (Subject-Verb-Object) language with prepositions.
|
|
773
|
+
*/
|
|
774
|
+
|
|
775
|
+
declare const ms: Dictionary;
|
|
776
|
+
|
|
777
|
+
declare const msKeywords: KeywordProvider;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Tagalog Dictionary
|
|
781
|
+
*
|
|
782
|
+
* Tagalog translations for hyperscript keywords.
|
|
783
|
+
* Tagalog is a VSO (Verb-Subject-Object) language with rich verbal morphology.
|
|
784
|
+
*/
|
|
785
|
+
|
|
786
|
+
declare const tl: Dictionary;
|
|
787
|
+
|
|
788
|
+
declare const tlKeywords: KeywordProvider;
|
|
789
|
+
|
|
697
790
|
/**
|
|
698
791
|
* LocaleManager - Centralized locale configuration for hyperscript parsing.
|
|
699
792
|
*
|
|
@@ -806,7 +899,7 @@ declare class LocaleManager {
|
|
|
806
899
|
* @example
|
|
807
900
|
* ```typescript
|
|
808
901
|
* import { detectBrowserLocale } from '@lokascript/i18n/parser';
|
|
809
|
-
* import { Parser } from '@
|
|
902
|
+
* import { Parser } from '@hyperfixi/core';
|
|
810
903
|
*
|
|
811
904
|
* // Auto-detect and use browser locale
|
|
812
905
|
* const parser = new Parser({ keywords: detectBrowserLocale() });
|
|
@@ -919,4 +1012,4 @@ declare const examples: {
|
|
|
919
1012
|
};
|
|
920
1013
|
};
|
|
921
1014
|
|
|
922
|
-
export {
|
|
1015
|
+
export { ko as $, type AdpositionType as A, frenchProfile as B, germanProfile as C, getProfile as D, ENGLISH_COMMANDS as E, getSupportedLocales as F, type GrammarRule as G, examples as H, hindiDictionary as I, hiKeywords as J, type KeywordProvider as K, LANGUAGE_FAMILY_DEFAULTS as L, type MorphologyType as M, id as N, idKeywords as O, type ParsedElement as P, indonesianProfile as Q, insertMarkers as R, type SemanticRole as S, it as T, UNIVERSAL_ENGLISH_KEYWORDS as U, itKeywords as V, type WordOrder as W, ja as X, jaKeywords as Y, japaneseProfile as Z, joinTokens as _, ENGLISH_KEYWORDS as a, koKeywords as a0, koreanProfile as a1, ms as a2, msKeywords as a3, parseStatement as a4, pl as a5, plKeywords as a6, portugueseProfile as a7, profiles as a8, pt as a9, zh as aA, zhKeywords as aB, ptKeywords as aa, qu as ab, quKeywords as ac, quechuaProfile as ad, reorderRoles as ae, russianDictionary as af, ruKeywords as ag, spanishProfile as ah, sw as ai, swKeywords as aj, swahiliProfile as ak, th as al, thKeywords as am, tl as an, tlKeywords as ao, toEnglish as ap, toLocale as aq, tr as ar, trKeywords as as, transformStatement as at, translate as au, turkishProfile as av, ukrainianDictionary as aw, ukKeywords as ax, vi as ay, viKeywords as az, GrammarTransformer as b, type GrammaticalMarker as c, type KeywordProviderOptions as d, type LanguageProfile as e, LocaleManager as f, type ParsedStatement as g, type PatternMatcher as h, type PatternTransform as i, UNIVERSAL_PATTERNS as j, ar as k, arKeywords as l, arabicProfile as m, bn as n, bnKeywords as o, chineseProfile as p, createEnglishProvider as q, createKeywordProvider as r, de as s, deKeywords as t, detectBrowserLocale as u, englishProfile as v, es as w, esKeywords as x, fr as y, frKeywords as z };
|
|
@@ -119,4 +119,4 @@ interface TranslationResult {
|
|
|
119
119
|
warnings?: string[];
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export { type Dictionary as D, type I18nConfig as I, type LocaleMetadata as L, type TranslationOptions as T, type ValidationResult as V, type TranslationResult as a, type Token as b,
|
|
122
|
+
export { type Dictionary as D, type I18nConfig as I, type LocaleMetadata as L, type TranslationOptions as T, type ValidationResult as V, type TranslationResult as a, type Token as b, DICTIONARY_CATEGORIES as c, type DictionaryCategory as d, type TokenType as e, type TranslationContext as f, type ValidationError as g, type ValidationWarning as h, findInDictionary as i, forEachCategory as j, getDictionaryCategory as k, isDictionaryCategory as l, translateFromEnglish as t };
|
|
@@ -119,4 +119,4 @@ interface TranslationResult {
|
|
|
119
119
|
warnings?: string[];
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export { type Dictionary as D, type I18nConfig as I, type LocaleMetadata as L, type TranslationOptions as T, type ValidationResult as V, type TranslationResult as a, type Token as b,
|
|
122
|
+
export { type Dictionary as D, type I18nConfig as I, type LocaleMetadata as L, type TranslationOptions as T, type ValidationResult as V, type TranslationResult as a, type Token as b, DICTIONARY_CATEGORIES as c, type DictionaryCategory as d, type TokenType as e, type TranslationContext as f, type ValidationError as g, type ValidationWarning as h, findInDictionary as i, forEachCategory as j, getDictionaryCategory as k, isDictionaryCategory as l, translateFromEnglish as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokascript/i18n",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Grammar transformation and keyword translation for hyperscript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"build:browser": "rollup -c rollup.config.mjs",
|
|
39
39
|
"dev": "tsup --watch",
|
|
40
40
|
"test": "vitest",
|
|
41
|
+
"test:check": "vitest run --reporter=dot 2>&1 | tail -5",
|
|
41
42
|
"test:coverage": "vitest run --coverage",
|
|
42
43
|
"typecheck": "tsc --noEmit",
|
|
43
44
|
"lint": "eslint src --ext ts,tsx",
|
|
@@ -52,21 +53,21 @@
|
|
|
52
53
|
"translation",
|
|
53
54
|
"localization"
|
|
54
55
|
],
|
|
55
|
-
"author": "
|
|
56
|
+
"author": "LokaScript Contributors",
|
|
56
57
|
"license": "MIT",
|
|
57
58
|
"repository": {
|
|
58
59
|
"type": "git",
|
|
59
|
-
"url": "git+https://github.com/codetalcott/
|
|
60
|
+
"url": "git+https://github.com/codetalcott/hyperfixi.git",
|
|
60
61
|
"directory": "packages/i18n"
|
|
61
62
|
},
|
|
62
63
|
"bugs": {
|
|
63
|
-
"url": "https://github.com/codetalcott/
|
|
64
|
+
"url": "https://github.com/codetalcott/hyperfixi/issues"
|
|
64
65
|
},
|
|
65
|
-
"homepage": "https://github.com/codetalcott/
|
|
66
|
+
"homepage": "https://github.com/codetalcott/hyperfixi/tree/main/packages/i18n#readme",
|
|
66
67
|
"dependencies": {
|
|
67
|
-
"@
|
|
68
|
+
"@hyperfixi/core": "*",
|
|
68
69
|
"@lokascript/semantic": "*",
|
|
69
|
-
"esbuild": "0.
|
|
70
|
+
"esbuild": "0.27.3",
|
|
70
71
|
"happy-dom": "20.0.6",
|
|
71
72
|
"vite": "^7.1.12"
|
|
72
73
|
},
|
package/src/browser.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Usage with ES modules:
|
|
20
20
|
* ```typescript
|
|
21
21
|
* import { esKeywords } from '@lokascript/i18n';
|
|
22
|
-
* import { Parser } from '@
|
|
22
|
+
* import { Parser } from '@hyperfixi/core';
|
|
23
23
|
*
|
|
24
24
|
* const parser = new Parser(tokens, { keywords: esKeywords });
|
|
25
25
|
* ```
|
|
@@ -49,11 +49,22 @@ export { idKeywords, idDictionary } from './parser/id';
|
|
|
49
49
|
export { quKeywords, quDictionary } from './parser/qu';
|
|
50
50
|
export { swKeywords, swDictionary } from './parser/sw';
|
|
51
51
|
export { ptKeywords, ptDictionary } from './parser/pt';
|
|
52
|
+
export { itKeywords, itDictionary } from './parser/it';
|
|
53
|
+
export { viKeywords, viDictionary } from './parser/vi';
|
|
54
|
+
export { plKeywords, plDictionary } from './parser/pl';
|
|
55
|
+
export { ruKeywords, ruDictionary } from './parser/ru';
|
|
56
|
+
export { ukKeywords, ukDictionary } from './parser/uk';
|
|
57
|
+
export { hiKeywords, hiDictionary } from './parser/hi';
|
|
58
|
+
export { bnKeywords, bnDictionary } from './parser/bn';
|
|
59
|
+
export { thKeywords, thDictionary } from './parser/th';
|
|
60
|
+
export { msKeywords, msDictionary } from './parser/ms';
|
|
61
|
+
export { tlKeywords, tlDictionary } from './parser/tl';
|
|
52
62
|
|
|
53
63
|
// Locale management
|
|
54
64
|
export { LocaleManager, detectBrowserLocale } from './parser/locale-manager';
|
|
55
65
|
|
|
56
66
|
// Re-export dictionaries for custom provider creation
|
|
67
|
+
export { en } from './dictionaries/en';
|
|
57
68
|
export { es } from './dictionaries/es';
|
|
58
69
|
export { ja } from './dictionaries/ja';
|
|
59
70
|
export { fr } from './dictionaries/fr';
|
|
@@ -66,6 +77,16 @@ export { id } from './dictionaries/id';
|
|
|
66
77
|
export { qu } from './dictionaries/qu';
|
|
67
78
|
export { sw } from './dictionaries/sw';
|
|
68
79
|
export { pt } from './dictionaries/pt';
|
|
80
|
+
export { it } from './dictionaries/it';
|
|
81
|
+
export { vi } from './dictionaries/vi';
|
|
82
|
+
export { pl } from './dictionaries/pl';
|
|
83
|
+
export { russianDictionary } from './dictionaries/ru';
|
|
84
|
+
export { ukrainianDictionary } from './dictionaries/uk';
|
|
85
|
+
export { hindiDictionary } from './dictionaries/hi';
|
|
86
|
+
export { bn } from './dictionaries/bn';
|
|
87
|
+
export { th } from './dictionaries/th';
|
|
88
|
+
export { ms } from './dictionaries/ms';
|
|
89
|
+
export { tl } from './dictionaries/tl';
|
|
69
90
|
|
|
70
91
|
// Grammar-aware transformation system (Phase 2)
|
|
71
92
|
export {
|
package/src/dictionaries/ar.ts
CHANGED
package/src/dictionaries/de.ts
CHANGED
package/src/dictionaries/en.ts
CHANGED
package/src/dictionaries/es.ts
CHANGED
package/src/dictionaries/fr.ts
CHANGED
package/src/dictionaries/hi.ts
CHANGED