@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.
- 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 +29 -80
- package/dist/dictionaries/index.d.ts +29 -80
- 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 +36 -36
- package/dist/index.d.ts +36 -36
- 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-DN_HqdDB.d.ts} +107 -14
- package/dist/{transformer-D8MM2_rz.d.cts → transformer-kXwlqa5b.d.cts} +107 -14
- package/package.json +7 -6
- 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
|
@@ -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 { type SemanticRole as $, ptKeywords as A, pt as B, itKeywords as C, it as D, ENGLISH_COMMANDS as E, viKeywords as F, vi as G, plKeywords as H, pl as I, ruKeywords as J, type KeywordProvider as K, russianDictionary as L, ukKeywords as M, ukrainianDictionary as N, hiKeywords as O, hindiDictionary as P, bnKeywords as Q, bn as R, thKeywords as S, th as T, UNIVERSAL_ENGLISH_KEYWORDS as U, msKeywords as V, ms as W, tlKeywords as X, tl as Y, LocaleManager as Z, detectBrowserLocale as _, type KeywordProviderOptions as a, type WordOrder as a0, type AdpositionType as a1, type MorphologyType as a2, type GrammaticalMarker as a3, type LanguageProfile as a4, type GrammarRule as a5, type PatternMatcher as a6, type PatternTransform as a7, type ParsedStatement as a8, type ParsedElement as a9, translate as aA, examples as aB, UNIVERSAL_PATTERNS as aa, LANGUAGE_FAMILY_DEFAULTS as ab, reorderRoles as ac, insertMarkers as ad, joinTokens as ae, transformStatement as af, profiles as ag, getProfile as ah, getSupportedLocales as ai, englishProfile as aj, japaneseProfile as ak, koreanProfile as al, chineseProfile as am, arabicProfile as an, turkishProfile as ao, spanishProfile as ap, germanProfile as aq, frenchProfile as ar, portugueseProfile as as, indonesianProfile as at, quechuaProfile as au, swahiliProfile as av, GrammarTransformer as aw, parseStatement as ax, toLocale as ay, toEnglish as az, createEnglishProvider as b, createKeywordProvider as c, ENGLISH_KEYWORDS as d, esKeywords as e, es as f, ja as g, frKeywords as h, fr as i, jaKeywords as j, deKeywords as k, de as l, arKeywords as m, ar as n, koKeywords as o, ko as p, zh as q, tr as r, idKeywords as s, trKeywords as t, id as u, quKeywords as v, qu as w, swKeywords as x, sw as y, zhKeywords as z };
|
|
@@ -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 { type SemanticRole as $, ptKeywords as A, pt as B, itKeywords as C, it as D, ENGLISH_COMMANDS as E, viKeywords as F, vi as G, plKeywords as H, pl as I, ruKeywords as J, type KeywordProvider as K, russianDictionary as L, ukKeywords as M, ukrainianDictionary as N, hiKeywords as O, hindiDictionary as P, bnKeywords as Q, bn as R, thKeywords as S, th as T, UNIVERSAL_ENGLISH_KEYWORDS as U, msKeywords as V, ms as W, tlKeywords as X, tl as Y, LocaleManager as Z, detectBrowserLocale as _, type KeywordProviderOptions as a, type WordOrder as a0, type AdpositionType as a1, type MorphologyType as a2, type GrammaticalMarker as a3, type LanguageProfile as a4, type GrammarRule as a5, type PatternMatcher as a6, type PatternTransform as a7, type ParsedStatement as a8, type ParsedElement as a9, translate as aA, examples as aB, UNIVERSAL_PATTERNS as aa, LANGUAGE_FAMILY_DEFAULTS as ab, reorderRoles as ac, insertMarkers as ad, joinTokens as ae, transformStatement as af, profiles as ag, getProfile as ah, getSupportedLocales as ai, englishProfile as aj, japaneseProfile as ak, koreanProfile as al, chineseProfile as am, arabicProfile as an, turkishProfile as ao, spanishProfile as ap, germanProfile as aq, frenchProfile as ar, portugueseProfile as as, indonesianProfile as at, quechuaProfile as au, swahiliProfile as av, GrammarTransformer as aw, parseStatement as ax, toLocale as ay, toEnglish as az, createEnglishProvider as b, createKeywordProvider as c, ENGLISH_KEYWORDS as d, esKeywords as e, es as f, ja as g, frKeywords as h, fr as i, jaKeywords as j, deKeywords as k, de as l, arKeywords as m, ar as n, koKeywords as o, ko as p, zh as q, tr as r, idKeywords as s, trKeywords as t, id as u, quKeywords as v, qu as w, swKeywords as x, sw as y, zhKeywords as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokascript/i18n",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.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,19 +53,19 @@
|
|
|
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
70
|
"esbuild": "0.25.11",
|
|
70
71
|
"happy-dom": "20.0.6",
|
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