@astroscope/i18n 0.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/README.md +262 -0
- package/dist/babel-plugin-FUTQRKLT.js +121 -0
- package/dist/babel-plugin-K2K4ZPM5.js +118 -0
- package/dist/chunk-22ZZFFC2.js +159 -0
- package/dist/chunk-2PSXD3JJ.js +144 -0
- package/dist/chunk-3VI62RLT.js +176 -0
- package/dist/chunk-4A5BKHFN.js +16 -0
- package/dist/chunk-4DAQPWXI.js +36 -0
- package/dist/chunk-4OGX6AF5.js +10 -0
- package/dist/chunk-4PHYKXO3.js +227 -0
- package/dist/chunk-4UBFISFY.js +376 -0
- package/dist/chunk-5DERF6DV.js +266 -0
- package/dist/chunk-5KGNHFTC.js +344 -0
- package/dist/chunk-5PP4D2VK.js +23 -0
- package/dist/chunk-6BW3PN23.js +14 -0
- package/dist/chunk-6ESQ4JQI.js +263 -0
- package/dist/chunk-A7MPXMOP.js +202 -0
- package/dist/chunk-AWZ2SQDW.js +149 -0
- package/dist/chunk-AYY2YIBQ.js +52 -0
- package/dist/chunk-BMNEJFTD.js +56 -0
- package/dist/chunk-BSXQGEUK.js +16 -0
- package/dist/chunk-BSYTJFGF.js +21 -0
- package/dist/chunk-BVPXEGTT.js +12 -0
- package/dist/chunk-C4DJYWF6.js +193 -0
- package/dist/chunk-C5EJYE2P.js +245 -0
- package/dist/chunk-CLNOQHMS.js +254 -0
- package/dist/chunk-E5MCIRSU.js +144 -0
- package/dist/chunk-E7ZJS7WX.js +162 -0
- package/dist/chunk-EMM6LRO2.js +8 -0
- package/dist/chunk-ESFGCYYH.js +24 -0
- package/dist/chunk-FAKBSLNW.js +24 -0
- package/dist/chunk-FHBVI3TL.js +372 -0
- package/dist/chunk-FI5KZ5IO.js +17 -0
- package/dist/chunk-H5R6YMOL.js +233 -0
- package/dist/chunk-H62K3FGA.js +236 -0
- package/dist/chunk-HDG2R6XT.js +211 -0
- package/dist/chunk-HGXU5QAK.js +344 -0
- package/dist/chunk-HHRMR3TM.js +17 -0
- package/dist/chunk-HS4HVBAD.js +127 -0
- package/dist/chunk-IPJWKKHJ.js +324 -0
- package/dist/chunk-ITTL4V7J.js +24 -0
- package/dist/chunk-IWUBCMOK.js +128 -0
- package/dist/chunk-JJBBY2GR.js +14 -0
- package/dist/chunk-JJEDOJBR.js +193 -0
- package/dist/chunk-JTUKXNIJ.js +23 -0
- package/dist/chunk-K7YULG4A.js +14 -0
- package/dist/chunk-KNDYKTHE.js +31 -0
- package/dist/chunk-KNONI6DP.js +89 -0
- package/dist/chunk-LMTEO22Y.js +17 -0
- package/dist/chunk-LRLZEX4D.js +147 -0
- package/dist/chunk-MFKPLUAN.js +241 -0
- package/dist/chunk-MIWXQOO3.js +316 -0
- package/dist/chunk-MJRTAWPR.js +261 -0
- package/dist/chunk-MZEPQCXX.js +249 -0
- package/dist/chunk-NHHTSFA7.js +237 -0
- package/dist/chunk-NTTXM7AG.js +23 -0
- package/dist/chunk-NZFAVJXR.js +192 -0
- package/dist/chunk-OFNFSDW3.js +13 -0
- package/dist/chunk-PG3XDNGF.js +227 -0
- package/dist/chunk-PVEVTPNK.js +139 -0
- package/dist/chunk-QAO4BXS4.js +244 -0
- package/dist/chunk-QCTULQQK.js +34 -0
- package/dist/chunk-QFAAGCP5.js +177 -0
- package/dist/chunk-QKND2KCA.js +163 -0
- package/dist/chunk-QZEGY6RJ.js +151 -0
- package/dist/chunk-RAE2L6FT.js +193 -0
- package/dist/chunk-S3ABJBU3.js +255 -0
- package/dist/chunk-SVDVCPCV.js +236 -0
- package/dist/chunk-T35ZUWTL.js +153 -0
- package/dist/chunk-T6WV5DW6.js +156 -0
- package/dist/chunk-TGUXVDA3.js +82 -0
- package/dist/chunk-TYMO7K3A.js +173 -0
- package/dist/chunk-V4RBFLQL.js +23 -0
- package/dist/chunk-V4XWJXXZ.js +23 -0
- package/dist/chunk-VQCY3OKK.js +258 -0
- package/dist/chunk-WLGOJPDJ.js +15 -0
- package/dist/chunk-WUEPDJIL.js +259 -0
- package/dist/chunk-X3L7WZLY.js +254 -0
- package/dist/chunk-XDD62ZM3.js +255 -0
- package/dist/chunk-XFXXEDRD.js +36 -0
- package/dist/chunk-XKYOR5UK.js +8 -0
- package/dist/chunk-Y26535SI.js +239 -0
- package/dist/chunk-Y3PQX5TX.js +152 -0
- package/dist/chunk-Y4BE2V6F.js +347 -0
- package/dist/chunk-Z4IZYDIA.js +24 -0
- package/dist/chunk-Z52G4CYY.js +14 -0
- package/dist/chunk-ZGLUYWVM.js +128 -0
- package/dist/client/directives/idle.d.ts +9 -0
- package/dist/client/directives/idle.js +15 -0
- package/dist/client/directives/load.d.ts +9 -0
- package/dist/client/directives/load.js +15 -0
- package/dist/client/directives/media.d.ts +9 -0
- package/dist/client/directives/media.js +15 -0
- package/dist/client/directives/only.d.ts +9 -0
- package/dist/client/directives/only.js +15 -0
- package/dist/client/directives/utils.d.ts +10 -0
- package/dist/client/directives/utils.js +7 -0
- package/dist/client/directives/visible.d.ts +9 -0
- package/dist/client/directives/visible.js +15 -0
- package/dist/client/import-with-i18n.d.ts +16 -0
- package/dist/client/import-with-i18n.js +8 -0
- package/dist/client/t.d.ts +20 -0
- package/dist/client/t.js +37 -0
- package/dist/client-directives/idle.d.ts +9 -0
- package/dist/client-directives/idle.js +15 -0
- package/dist/client-directives/load.d.ts +9 -0
- package/dist/client-directives/load.js +15 -0
- package/dist/client-directives/media.d.ts +9 -0
- package/dist/client-directives/media.js +15 -0
- package/dist/client-directives/only.d.ts +9 -0
- package/dist/client-directives/only.js +15 -0
- package/dist/client-directives/utils.d.ts +9 -0
- package/dist/client-directives/utils.js +7 -0
- package/dist/client-directives/visible.d.ts +9 -0
- package/dist/client-directives/visible.js +15 -0
- package/dist/extraction/index.d.ts +34 -0
- package/dist/extraction/index.js +9 -0
- package/dist/i18n-3cZHoHwP.d.ts +86 -0
- package/dist/i18n-BGfrSNM8.d.ts +56 -0
- package/dist/i18n-BHU81LMA.d.ts +55 -0
- package/dist/i18n-BagoeH4_.d.ts +62 -0
- package/dist/i18n-BeL84090.d.ts +77 -0
- package/dist/i18n-BeRWDfHi.d.ts +55 -0
- package/dist/i18n-Bfs2PVcf.d.ts +79 -0
- package/dist/i18n-BrL7p3aN.d.ts +99 -0
- package/dist/i18n-CNQNCFU0.d.ts +55 -0
- package/dist/i18n-CX_uU8V2.d.ts +80 -0
- package/dist/i18n-Cr1QZCwe.d.ts +64 -0
- package/dist/i18n-CzTRxGeX.d.ts +80 -0
- package/dist/i18n-DUOFiC7g.d.ts +77 -0
- package/dist/i18n-DcF47BHS.d.ts +77 -0
- package/dist/i18n-DifWvtaO.d.ts +60 -0
- package/dist/i18n-DumSqX1t.d.ts +55 -0
- package/dist/i18n-fWTJw12h.d.ts +80 -0
- package/dist/import-with-i18n.d.ts +23 -0
- package/dist/import-with-i18n.js +7 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +151 -0
- package/dist/init.d.ts +2 -0
- package/dist/init.js +8 -0
- package/dist/internal.d.ts +11 -0
- package/dist/internal.js +9 -0
- package/dist/middleware-entrypoint-C0Drh9E_.d.ts +29 -0
- package/dist/middleware-entrypoint-mEl66IUy.d.ts +29 -0
- package/dist/middleware-entrypoint.d.ts +5 -0
- package/dist/middleware-entrypoint.js +30 -0
- package/dist/server/middleware-entrypoint.d.ts +2 -0
- package/dist/server/middleware-entrypoint.js +28 -0
- package/dist/server/t.d.ts +17 -0
- package/dist/server/t.js +59 -0
- package/dist/t-BY_C9lZ1.d.ts +30 -0
- package/dist/t-CG3yDiEa.d.ts +30 -0
- package/dist/t-CHsBfrPr.d.ts +30 -0
- package/dist/t-DQpXaDhP.d.ts +30 -0
- package/dist/t.client.d.ts +11 -0
- package/dist/t.client.js +35 -0
- package/dist/t.server.d.ts +22 -0
- package/dist/t.server.js +12 -0
- package/dist/types-8uKCwFda.d.ts +24 -0
- package/dist/types-BC6K-pID.d.ts +110 -0
- package/dist/types-BUV7BZML.d.ts +55 -0
- package/dist/types-BWGB322F.d.ts +46 -0
- package/dist/types-B_-RxW4A.d.ts +7 -0
- package/dist/types-BaaSiz9n.d.ts +7 -0
- package/dist/types-Bgl2V5xo.d.ts +102 -0
- package/dist/types-BwhB6IT4.d.ts +111 -0
- package/dist/types-Bzp6KxsI.d.ts +50 -0
- package/dist/types-C6rOJFY2.d.ts +24 -0
- package/dist/types-C7lD-Woj.d.ts +50 -0
- package/dist/types-CLWZeQhD.d.ts +54 -0
- package/dist/types-COXt613w.d.ts +19 -0
- package/dist/types-CUlkbl9-.d.ts +50 -0
- package/dist/types-CVv7GGPj.d.ts +46 -0
- package/dist/types-CiIDN2sW.d.ts +64 -0
- package/dist/types-Cr86qjYl.d.ts +58 -0
- package/dist/types-CxnObiEO.d.ts +7 -0
- package/dist/types-D44mFUjA.d.ts +97 -0
- package/dist/types-D85m9UTC.d.ts +137 -0
- package/dist/types-DWhsmSPP.d.ts +102 -0
- package/dist/types-DdprXGJ1.d.ts +46 -0
- package/dist/types-DhVJ2ZIo.d.ts +43 -0
- package/dist/types-DnbOuM1L.d.ts +7 -0
- package/dist/types-DsNK_9sI.d.ts +24 -0
- package/dist/types-DvWBr9Xp.d.ts +17 -0
- package/dist/types-DwkIalh6.d.ts +24 -0
- package/dist/types-OYRgjtE_.d.ts +110 -0
- package/dist/types-SV8S05GX.d.ts +7 -0
- package/dist/types-TYn9WnxY.d.ts +46 -0
- package/dist/types-aXCBbdhq.d.ts +55 -0
- package/dist/types-gn4aNKGx.d.ts +54 -0
- package/dist/types-nippsMkm.d.ts +54 -0
- package/package.json +105 -0
- package/src/components/I18nScript.astro +37 -0
- package/src/components/index.ts +2 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { C as ChunkManifest, a as ExtractedKey, E as ExtractionManifest } from './types-C6rOJFY2.js';
|
|
2
|
+
import { a as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-CLWZeQhD.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fallback behavior when translation is missing
|
|
6
|
+
*/
|
|
7
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
8
|
+
/**
|
|
9
|
+
* Request-scoped i18n context
|
|
10
|
+
*/
|
|
11
|
+
type I18nContext = {
|
|
12
|
+
locale: string;
|
|
13
|
+
translations: CompiledTranslations;
|
|
14
|
+
fallback: FallbackBehavior;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type I18nConfig = {
|
|
18
|
+
locales: string[];
|
|
19
|
+
defaultLocale?: string | undefined;
|
|
20
|
+
fallback?: FallbackBehavior | undefined;
|
|
21
|
+
};
|
|
22
|
+
type NormalizedConfig = {
|
|
23
|
+
locales: string[];
|
|
24
|
+
defaultLocale: string;
|
|
25
|
+
fallback: FallbackBehavior;
|
|
26
|
+
};
|
|
27
|
+
declare class I18nSingleton {
|
|
28
|
+
private config;
|
|
29
|
+
private rawCache;
|
|
30
|
+
private compiledCache;
|
|
31
|
+
private hashCache;
|
|
32
|
+
private manifestGetter;
|
|
33
|
+
private manifestCache;
|
|
34
|
+
configure(config: I18nConfig): void;
|
|
35
|
+
isConfigured(): boolean;
|
|
36
|
+
getConfig(): NormalizedConfig;
|
|
37
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
38
|
+
getTranslations(locale: string): RawTranslations;
|
|
39
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
40
|
+
getChunkManifest(): ChunkManifest;
|
|
41
|
+
/**
|
|
42
|
+
* Get extracted translation keys with metadata (sync, uses cached manifest).
|
|
43
|
+
* Use getExtractedKeysAsync() for fresh data in dev mode.
|
|
44
|
+
*/
|
|
45
|
+
getExtractedKeys(): ExtractedKey[];
|
|
46
|
+
/**
|
|
47
|
+
* Async fetch of extracted translation keys with metadata.
|
|
48
|
+
* In dev mode, this re-imports the virtual module to get freshly extracted keys.
|
|
49
|
+
* Use this to populate your translation provider with keys extracted from the codebase.
|
|
50
|
+
*/
|
|
51
|
+
getExtractedKeysAsync(): Promise<ExtractedKey[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Get the full extraction manifest (keys + chunks).
|
|
54
|
+
* Returns cached manifest or empty default if not yet fetched.
|
|
55
|
+
* Use getExtractionManifestAsync() for fresh data in dev mode.
|
|
56
|
+
*/
|
|
57
|
+
getExtractionManifest(): ExtractionManifest;
|
|
58
|
+
/**
|
|
59
|
+
* Async fetch of extraction manifest.
|
|
60
|
+
* In dev mode, this re-imports the virtual module to get fresh extracted keys.
|
|
61
|
+
* In build mode, returns the cached manifest.
|
|
62
|
+
*/
|
|
63
|
+
getExtractionManifestAsync(): Promise<ExtractionManifest>;
|
|
64
|
+
/**
|
|
65
|
+
* Set the manifest getter function (called by init module).
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
setManifestGetter(getter: () => Promise<ExtractionManifest>): void;
|
|
69
|
+
getHashes(locale: string): Record<string, string>;
|
|
70
|
+
/**
|
|
71
|
+
* Clear translations for specified locale(s).
|
|
72
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
73
|
+
*/
|
|
74
|
+
clear(locales?: string | string[] | undefined): void;
|
|
75
|
+
private resolveLocales;
|
|
76
|
+
}
|
|
77
|
+
declare const i18n: I18nSingleton;
|
|
78
|
+
|
|
79
|
+
export { type FallbackBehavior as F, type I18nContext as I, type I18nConfig as a, i18n as i };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { a as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-CLWZeQhD.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extracted metadata for a single translation key
|
|
5
|
+
*/
|
|
6
|
+
type ExtractedKey = {
|
|
7
|
+
key: string;
|
|
8
|
+
meta: TranslationMeta;
|
|
9
|
+
file: string;
|
|
10
|
+
line: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Chunk-to-keys mapping produced by Vite plugin
|
|
14
|
+
*/
|
|
15
|
+
type ChunkManifest = Record<string, string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Full extraction manifest
|
|
18
|
+
*/
|
|
19
|
+
type ExtractionManifest = {
|
|
20
|
+
keys: ExtractedKey[];
|
|
21
|
+
chunks: ChunkManifest;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Fallback behavior when translation is missing
|
|
26
|
+
*/
|
|
27
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
28
|
+
/**
|
|
29
|
+
* Request-scoped i18n context
|
|
30
|
+
*/
|
|
31
|
+
type I18nContext = {
|
|
32
|
+
locale: string;
|
|
33
|
+
translations: CompiledTranslations;
|
|
34
|
+
fallback: FallbackBehavior;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type I18nConfig = {
|
|
38
|
+
locales: string[];
|
|
39
|
+
defaultLocale?: string | undefined;
|
|
40
|
+
fallback?: FallbackBehavior | undefined;
|
|
41
|
+
};
|
|
42
|
+
type NormalizedConfig = {
|
|
43
|
+
locales: string[];
|
|
44
|
+
defaultLocale: string;
|
|
45
|
+
fallback: FallbackBehavior;
|
|
46
|
+
};
|
|
47
|
+
declare class I18nSingleton {
|
|
48
|
+
private config;
|
|
49
|
+
private rawCache;
|
|
50
|
+
private compiledCache;
|
|
51
|
+
private hashCache;
|
|
52
|
+
private manifestGetter;
|
|
53
|
+
private manifestCache;
|
|
54
|
+
configure(config: I18nConfig): void;
|
|
55
|
+
isConfigured(): boolean;
|
|
56
|
+
getConfig(): NormalizedConfig;
|
|
57
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
58
|
+
getTranslations(locale: string): RawTranslations;
|
|
59
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
60
|
+
getChunkManifest(): ChunkManifest;
|
|
61
|
+
/**
|
|
62
|
+
* Get extracted translation keys with metadata (sync, uses cached manifest).
|
|
63
|
+
* Use getExtractedKeysAsync() for fresh data in dev mode.
|
|
64
|
+
*/
|
|
65
|
+
getExtractedKeys(): ExtractedKey[];
|
|
66
|
+
/**
|
|
67
|
+
* Async fetch of extracted translation keys with metadata.
|
|
68
|
+
* In dev mode, this re-imports the virtual module to get freshly extracted keys.
|
|
69
|
+
* Use this to populate your translation provider with keys extracted from the codebase.
|
|
70
|
+
*/
|
|
71
|
+
getExtractedKeysAsync(): Promise<ExtractedKey[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Get the full extraction manifest (keys + chunks).
|
|
74
|
+
* Returns cached manifest or empty default if not yet fetched.
|
|
75
|
+
* Use getExtractionManifestAsync() for fresh data in dev mode.
|
|
76
|
+
*/
|
|
77
|
+
getExtractionManifest(): ExtractionManifest;
|
|
78
|
+
/**
|
|
79
|
+
* Async fetch of extraction manifest.
|
|
80
|
+
* In dev mode, this re-imports the virtual module to get fresh extracted keys.
|
|
81
|
+
* In build mode, returns the cached manifest.
|
|
82
|
+
*/
|
|
83
|
+
getExtractionManifestAsync(): Promise<ExtractionManifest>;
|
|
84
|
+
/**
|
|
85
|
+
* Set the manifest getter function (called by init module).
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
setManifestGetter(getter: () => Promise<ExtractionManifest>): void;
|
|
89
|
+
getHashes(locale: string): Record<string, string>;
|
|
90
|
+
/**
|
|
91
|
+
* Clear translations for specified locale(s).
|
|
92
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
93
|
+
*/
|
|
94
|
+
clear(locales?: string | string[] | undefined): void;
|
|
95
|
+
private resolveLocales;
|
|
96
|
+
}
|
|
97
|
+
declare const i18n: I18nSingleton;
|
|
98
|
+
|
|
99
|
+
export { type ExtractedKey as E, type FallbackBehavior as F, type I18nContext as I, type I18nConfig as a, type ExtractionManifest as b, i18n as i };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { a as ExtractionManifest } from './types-DwkIalh6.js';
|
|
2
|
+
import { T as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-gn4aNKGx.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fallback behavior when translation is missing
|
|
6
|
+
*/
|
|
7
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
8
|
+
/**
|
|
9
|
+
* Request-scoped i18n context
|
|
10
|
+
*/
|
|
11
|
+
type I18nContext = {
|
|
12
|
+
locale: string;
|
|
13
|
+
translations: CompiledTranslations;
|
|
14
|
+
fallback: FallbackBehavior;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type I18nConfig = {
|
|
18
|
+
locales: string[];
|
|
19
|
+
defaultLocale?: string | undefined;
|
|
20
|
+
fallback?: FallbackBehavior | undefined;
|
|
21
|
+
};
|
|
22
|
+
type NormalizedConfig = {
|
|
23
|
+
locales: string[];
|
|
24
|
+
defaultLocale: string;
|
|
25
|
+
fallback: FallbackBehavior;
|
|
26
|
+
};
|
|
27
|
+
declare class I18nSingleton {
|
|
28
|
+
private config;
|
|
29
|
+
private rawCache;
|
|
30
|
+
private compiledCache;
|
|
31
|
+
private hashCache;
|
|
32
|
+
private manifestGetter;
|
|
33
|
+
configure(config: I18nConfig): Promise<void>;
|
|
34
|
+
isConfigured(): boolean;
|
|
35
|
+
getConfig(): NormalizedConfig;
|
|
36
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
37
|
+
getTranslations(locale: string): RawTranslations;
|
|
38
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
39
|
+
/**
|
|
40
|
+
* Get the extraction manifest (keys + chunks).
|
|
41
|
+
* - keys: translation keys extracted from codebase with metadata
|
|
42
|
+
* - chunks: mapping of chunk names to their translation keys
|
|
43
|
+
*/
|
|
44
|
+
getManifest(): ExtractionManifest;
|
|
45
|
+
getHashes(locale: string): Record<string, string>;
|
|
46
|
+
/**
|
|
47
|
+
* Clear translations for specified locale(s).
|
|
48
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
49
|
+
*/
|
|
50
|
+
clear(locales?: string | string[] | undefined): void;
|
|
51
|
+
private resolveLocales;
|
|
52
|
+
}
|
|
53
|
+
declare const i18n: I18nSingleton;
|
|
54
|
+
|
|
55
|
+
export { type FallbackBehavior as F, type I18nConfig as I, type I18nContext as a, i18n as i };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { T as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-gn4aNKGx.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extracted metadata for a single translation key
|
|
5
|
+
*/
|
|
6
|
+
type ExtractedKey = {
|
|
7
|
+
key: string;
|
|
8
|
+
meta: TranslationMeta;
|
|
9
|
+
file: string;
|
|
10
|
+
line: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Chunk-to-keys mapping produced by Vite plugin
|
|
14
|
+
*/
|
|
15
|
+
type ChunkManifest = Record<string, string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Full extraction manifest
|
|
18
|
+
*/
|
|
19
|
+
type ExtractionManifest = {
|
|
20
|
+
keys: ExtractedKey[];
|
|
21
|
+
chunks: ChunkManifest;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Fallback behavior when translation is missing
|
|
26
|
+
*/
|
|
27
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
28
|
+
/**
|
|
29
|
+
* Request-scoped i18n context
|
|
30
|
+
*/
|
|
31
|
+
type I18nContext = {
|
|
32
|
+
locale: string;
|
|
33
|
+
translations: CompiledTranslations;
|
|
34
|
+
fallback: FallbackBehavior;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type I18nConfig = {
|
|
38
|
+
locales: string[];
|
|
39
|
+
defaultLocale?: string | undefined;
|
|
40
|
+
fallback?: FallbackBehavior | undefined;
|
|
41
|
+
};
|
|
42
|
+
type NormalizedConfig = {
|
|
43
|
+
locales: string[];
|
|
44
|
+
defaultLocale: string;
|
|
45
|
+
fallback: FallbackBehavior;
|
|
46
|
+
};
|
|
47
|
+
declare class I18nSingleton {
|
|
48
|
+
private config;
|
|
49
|
+
private rawCache;
|
|
50
|
+
private compiledCache;
|
|
51
|
+
private extractionManifest;
|
|
52
|
+
private hashCache;
|
|
53
|
+
configure(config: I18nConfig): void;
|
|
54
|
+
isConfigured(): boolean;
|
|
55
|
+
getConfig(): NormalizedConfig;
|
|
56
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
57
|
+
getTranslations(locale: string): RawTranslations;
|
|
58
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
59
|
+
getChunkManifest(): ChunkManifest;
|
|
60
|
+
/**
|
|
61
|
+
* Get extracted translation keys with metadata.
|
|
62
|
+
* Use this to populate your translation provider with keys extracted from the codebase.
|
|
63
|
+
*/
|
|
64
|
+
getExtractedKeys(): ExtractedKey[] | null;
|
|
65
|
+
/**
|
|
66
|
+
* Get the full extraction manifest (keys + chunks).
|
|
67
|
+
* Returns null in dev mode (manifest doesn't exist).
|
|
68
|
+
*/
|
|
69
|
+
getExtractionManifest(): ExtractionManifest | null;
|
|
70
|
+
getHashes(locale: string): Record<string, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Clear translations for specified locale(s).
|
|
73
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
74
|
+
*/
|
|
75
|
+
clear(locales?: string | string[] | undefined): void;
|
|
76
|
+
private resolveLocales;
|
|
77
|
+
}
|
|
78
|
+
declare const i18n: I18nSingleton;
|
|
79
|
+
|
|
80
|
+
export { type ExtractedKey as E, type FallbackBehavior as F, type I18nConfig as I, type ExtractionManifest as a, type I18nContext as b, i18n as i };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { C as ChunkManifest, a as ExtractedKey, E as ExtractionManifest } from './types-C6rOJFY2.js';
|
|
2
|
+
import { a as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-CLWZeQhD.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fallback behavior when translation is missing
|
|
6
|
+
*/
|
|
7
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
8
|
+
/**
|
|
9
|
+
* Request-scoped i18n context
|
|
10
|
+
*/
|
|
11
|
+
type I18nContext = {
|
|
12
|
+
locale: string;
|
|
13
|
+
translations: CompiledTranslations;
|
|
14
|
+
fallback: FallbackBehavior;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type I18nConfig = {
|
|
18
|
+
locales: string[];
|
|
19
|
+
defaultLocale?: string | undefined;
|
|
20
|
+
fallback?: FallbackBehavior | undefined;
|
|
21
|
+
};
|
|
22
|
+
type NormalizedConfig = {
|
|
23
|
+
locales: string[];
|
|
24
|
+
defaultLocale: string;
|
|
25
|
+
fallback: FallbackBehavior;
|
|
26
|
+
};
|
|
27
|
+
declare class I18nSingleton {
|
|
28
|
+
private config;
|
|
29
|
+
private rawCache;
|
|
30
|
+
private compiledCache;
|
|
31
|
+
private hashCache;
|
|
32
|
+
private manifest;
|
|
33
|
+
configure(config: I18nConfig): void;
|
|
34
|
+
isConfigured(): boolean;
|
|
35
|
+
getConfig(): NormalizedConfig;
|
|
36
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
37
|
+
getTranslations(locale: string): RawTranslations;
|
|
38
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
39
|
+
getChunkManifest(): ChunkManifest;
|
|
40
|
+
/**
|
|
41
|
+
* Get extracted translation keys with metadata.
|
|
42
|
+
* Use this to populate your translation provider with keys extracted from the codebase.
|
|
43
|
+
*/
|
|
44
|
+
getExtractedKeys(): ExtractedKey[];
|
|
45
|
+
/**
|
|
46
|
+
* Get the full extraction manifest (keys + chunks).
|
|
47
|
+
*/
|
|
48
|
+
getExtractionManifest(): ExtractionManifest;
|
|
49
|
+
/**
|
|
50
|
+
* Set the extraction manifest (called by init module).
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
setManifest(manifest: ExtractionManifest): void;
|
|
54
|
+
getHashes(locale: string): Record<string, string>;
|
|
55
|
+
/**
|
|
56
|
+
* Clear translations for specified locale(s).
|
|
57
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
58
|
+
*/
|
|
59
|
+
clear(locales?: string | string[] | undefined): void;
|
|
60
|
+
private resolveLocales;
|
|
61
|
+
}
|
|
62
|
+
declare const i18n: I18nSingleton;
|
|
63
|
+
|
|
64
|
+
export { type FallbackBehavior as F, type I18nContext as I, type I18nConfig as a, i18n as i };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { T as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-gn4aNKGx.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extracted metadata for a single translation key
|
|
5
|
+
*/
|
|
6
|
+
type ExtractedKey = {
|
|
7
|
+
key: string;
|
|
8
|
+
meta: TranslationMeta;
|
|
9
|
+
file: string;
|
|
10
|
+
line: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Chunk-to-keys mapping produced by Vite plugin
|
|
14
|
+
*/
|
|
15
|
+
type ChunkManifest = Record<string, string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Full extraction manifest
|
|
18
|
+
*/
|
|
19
|
+
type ExtractionManifest = {
|
|
20
|
+
keys: ExtractedKey[];
|
|
21
|
+
chunks: ChunkManifest;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Fallback behavior when translation is missing
|
|
26
|
+
*/
|
|
27
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
28
|
+
/**
|
|
29
|
+
* Request-scoped i18n context
|
|
30
|
+
*/
|
|
31
|
+
type I18nContext = {
|
|
32
|
+
locale: string;
|
|
33
|
+
translations: CompiledTranslations;
|
|
34
|
+
fallback: FallbackBehavior;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type I18nConfig = {
|
|
38
|
+
locales: string[];
|
|
39
|
+
defaultLocale?: string | undefined;
|
|
40
|
+
fallback?: FallbackBehavior | undefined;
|
|
41
|
+
};
|
|
42
|
+
type NormalizedConfig = {
|
|
43
|
+
locales: string[];
|
|
44
|
+
defaultLocale: string;
|
|
45
|
+
fallback: FallbackBehavior;
|
|
46
|
+
};
|
|
47
|
+
declare class I18nSingleton {
|
|
48
|
+
private config;
|
|
49
|
+
private rawCache;
|
|
50
|
+
private compiledCache;
|
|
51
|
+
private hashCache;
|
|
52
|
+
configure(config: I18nConfig): void;
|
|
53
|
+
isConfigured(): boolean;
|
|
54
|
+
getConfig(): NormalizedConfig;
|
|
55
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
56
|
+
getTranslations(locale: string): RawTranslations;
|
|
57
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
58
|
+
getChunkManifest(): ChunkManifest;
|
|
59
|
+
/**
|
|
60
|
+
* Get extracted translation keys with metadata.
|
|
61
|
+
* Use this to populate your translation provider with keys extracted from the codebase.
|
|
62
|
+
*/
|
|
63
|
+
getExtractedKeys(): ExtractedKey[];
|
|
64
|
+
/**
|
|
65
|
+
* Get the full extraction manifest (keys + chunks).
|
|
66
|
+
* In dev mode, keys are available live but chunks are empty.
|
|
67
|
+
* In build mode, both keys and chunk mappings are populated.
|
|
68
|
+
*/
|
|
69
|
+
getExtractionManifest(): ExtractionManifest;
|
|
70
|
+
getHashes(locale: string): Record<string, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Clear translations for specified locale(s).
|
|
73
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
74
|
+
*/
|
|
75
|
+
clear(locales?: string | string[] | undefined): void;
|
|
76
|
+
private resolveLocales;
|
|
77
|
+
}
|
|
78
|
+
declare const i18n: I18nSingleton;
|
|
79
|
+
|
|
80
|
+
export { type ExtractedKey as E, type FallbackBehavior as F, type I18nConfig as I, type ExtractionManifest as a, type I18nContext as b, i18n as i };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { T as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-nippsMkm.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extracted metadata for a single translation key
|
|
5
|
+
*/
|
|
6
|
+
type ExtractedKey = {
|
|
7
|
+
key: string;
|
|
8
|
+
meta: TranslationMeta;
|
|
9
|
+
file: string;
|
|
10
|
+
line: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Chunk-to-keys mapping produced by Vite plugin
|
|
14
|
+
*/
|
|
15
|
+
type ChunkManifest = Record<string, string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Full extraction manifest
|
|
18
|
+
*/
|
|
19
|
+
type ExtractionManifest = {
|
|
20
|
+
keys: ExtractedKey[];
|
|
21
|
+
chunks: ChunkManifest;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Fallback behavior when translation is missing
|
|
26
|
+
*/
|
|
27
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
28
|
+
/**
|
|
29
|
+
* Request-scoped i18n context
|
|
30
|
+
*/
|
|
31
|
+
type I18nContext = {
|
|
32
|
+
locale: string;
|
|
33
|
+
translations: CompiledTranslations;
|
|
34
|
+
fallback: FallbackBehavior;
|
|
35
|
+
meta: Record<string, TranslationMeta>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type I18nConfig = {
|
|
39
|
+
locales: string[];
|
|
40
|
+
defaultLocale?: string | undefined;
|
|
41
|
+
fallback?: FallbackBehavior | undefined;
|
|
42
|
+
};
|
|
43
|
+
declare class I18nSingleton {
|
|
44
|
+
private config;
|
|
45
|
+
private rawCache;
|
|
46
|
+
private compiledCache;
|
|
47
|
+
private extractionManifest;
|
|
48
|
+
private hashCache;
|
|
49
|
+
configure(config: I18nConfig): void;
|
|
50
|
+
getConfig(): I18nConfig | null;
|
|
51
|
+
getDefaultLocale(): string | undefined;
|
|
52
|
+
getFallbackBehavior(): FallbackBehavior;
|
|
53
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
54
|
+
getTranslations(locale: string): RawTranslations;
|
|
55
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
56
|
+
getChunkManifest(): ChunkManifest;
|
|
57
|
+
/**
|
|
58
|
+
* Get extracted translation keys with metadata.
|
|
59
|
+
* Use this to populate your CMS with keys extracted from the codebase.
|
|
60
|
+
*/
|
|
61
|
+
getExtractedKeys(): ExtractedKey[] | null;
|
|
62
|
+
/**
|
|
63
|
+
* Get the full extraction manifest (keys + chunks).
|
|
64
|
+
* Returns null in dev mode (manifest doesn't exist).
|
|
65
|
+
*/
|
|
66
|
+
getExtractionManifest(): ExtractionManifest | null;
|
|
67
|
+
getHashes(locale: string): Record<string, string>;
|
|
68
|
+
/**
|
|
69
|
+
* Clear translations for specified locale(s).
|
|
70
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
71
|
+
*/
|
|
72
|
+
clear(locales?: string | string[] | undefined): void;
|
|
73
|
+
private resolveLocales;
|
|
74
|
+
}
|
|
75
|
+
declare const i18n: I18nSingleton;
|
|
76
|
+
|
|
77
|
+
export { type ExtractedKey as E, type FallbackBehavior as F, type I18nConfig as I, type ExtractionManifest as a, type I18nContext as b, i18n as i };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { T as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-nippsMkm.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extracted metadata for a single translation key
|
|
5
|
+
*/
|
|
6
|
+
type ExtractedKey = {
|
|
7
|
+
key: string;
|
|
8
|
+
meta: TranslationMeta;
|
|
9
|
+
file: string;
|
|
10
|
+
line: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Chunk-to-keys mapping produced by Vite plugin
|
|
14
|
+
*/
|
|
15
|
+
type ChunkManifest = Record<string, string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Full extraction manifest
|
|
18
|
+
*/
|
|
19
|
+
type ExtractionManifest = {
|
|
20
|
+
keys: ExtractedKey[];
|
|
21
|
+
chunks: ChunkManifest;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Fallback behavior when translation is missing
|
|
26
|
+
*/
|
|
27
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
28
|
+
/**
|
|
29
|
+
* Request-scoped i18n context
|
|
30
|
+
*/
|
|
31
|
+
type I18nContext = {
|
|
32
|
+
locale: string;
|
|
33
|
+
translations: CompiledTranslations;
|
|
34
|
+
fallback: FallbackBehavior;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type I18nConfig = {
|
|
38
|
+
locales: string[];
|
|
39
|
+
defaultLocale?: string | undefined;
|
|
40
|
+
fallback?: FallbackBehavior | undefined;
|
|
41
|
+
};
|
|
42
|
+
declare class I18nSingleton {
|
|
43
|
+
private config;
|
|
44
|
+
private rawCache;
|
|
45
|
+
private compiledCache;
|
|
46
|
+
private extractionManifest;
|
|
47
|
+
private hashCache;
|
|
48
|
+
configure(config: I18nConfig): void;
|
|
49
|
+
isConfigured(): boolean;
|
|
50
|
+
getConfig(): I18nConfig;
|
|
51
|
+
getDefaultLocale(): string;
|
|
52
|
+
getFallbackBehavior(): FallbackBehavior;
|
|
53
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
54
|
+
getTranslations(locale: string): RawTranslations;
|
|
55
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
56
|
+
getChunkManifest(): ChunkManifest;
|
|
57
|
+
/**
|
|
58
|
+
* Get extracted translation keys with metadata.
|
|
59
|
+
* Use this to populate your CMS with keys extracted from the codebase.
|
|
60
|
+
*/
|
|
61
|
+
getExtractedKeys(): ExtractedKey[] | null;
|
|
62
|
+
/**
|
|
63
|
+
* Get the full extraction manifest (keys + chunks).
|
|
64
|
+
* Returns null in dev mode (manifest doesn't exist).
|
|
65
|
+
*/
|
|
66
|
+
getExtractionManifest(): ExtractionManifest | null;
|
|
67
|
+
getHashes(locale: string): Record<string, string>;
|
|
68
|
+
/**
|
|
69
|
+
* Clear translations for specified locale(s).
|
|
70
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
71
|
+
*/
|
|
72
|
+
clear(locales?: string | string[] | undefined): void;
|
|
73
|
+
private resolveLocales;
|
|
74
|
+
}
|
|
75
|
+
declare const i18n: I18nSingleton;
|
|
76
|
+
|
|
77
|
+
export { type ExtractedKey as E, type FallbackBehavior as F, type I18nConfig as I, type ExtractionManifest as a, type I18nContext as b, i18n as i };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { E as ExtractionManifest } from './types-C6rOJFY2.js';
|
|
2
|
+
import { a as TranslationMeta, C as CompiledTranslations, R as RawTranslations } from './types-CLWZeQhD.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fallback behavior when translation is missing
|
|
6
|
+
*/
|
|
7
|
+
type FallbackBehavior = 'key' | 'fallback' | 'throw' | ((key: string, meta?: TranslationMeta | undefined) => string);
|
|
8
|
+
/**
|
|
9
|
+
* Request-scoped i18n context
|
|
10
|
+
*/
|
|
11
|
+
type I18nContext = {
|
|
12
|
+
locale: string;
|
|
13
|
+
translations: CompiledTranslations;
|
|
14
|
+
fallback: FallbackBehavior;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type I18nConfig = {
|
|
18
|
+
locales: string[];
|
|
19
|
+
defaultLocale?: string | undefined;
|
|
20
|
+
fallback?: FallbackBehavior | undefined;
|
|
21
|
+
};
|
|
22
|
+
type NormalizedConfig = {
|
|
23
|
+
locales: string[];
|
|
24
|
+
defaultLocale: string;
|
|
25
|
+
fallback: FallbackBehavior;
|
|
26
|
+
};
|
|
27
|
+
declare class I18nSingleton {
|
|
28
|
+
private config;
|
|
29
|
+
private rawCache;
|
|
30
|
+
private compiledCache;
|
|
31
|
+
private hashCache;
|
|
32
|
+
private manifest;
|
|
33
|
+
configure(config: I18nConfig): void;
|
|
34
|
+
isConfigured(): boolean;
|
|
35
|
+
getConfig(): NormalizedConfig;
|
|
36
|
+
setTranslations(locale: string, raw: RawTranslations): void;
|
|
37
|
+
getTranslations(locale: string): RawTranslations;
|
|
38
|
+
getCompiledTranslations(locale: string): CompiledTranslations;
|
|
39
|
+
/**
|
|
40
|
+
* Get the extraction manifest (keys + chunks).
|
|
41
|
+
* - keys: translation keys extracted from codebase with metadata
|
|
42
|
+
* - chunks: mapping of chunk names to their translation keys
|
|
43
|
+
*/
|
|
44
|
+
getManifest(): ExtractionManifest;
|
|
45
|
+
/**
|
|
46
|
+
* Set the extraction manifest (called by init module).
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
setManifest(manifest: ExtractionManifest): void;
|
|
50
|
+
getHashes(locale: string): Record<string, string>;
|
|
51
|
+
/**
|
|
52
|
+
* Clear translations for specified locale(s).
|
|
53
|
+
* @param locales - Locale(s) to clear, or all if not specified
|
|
54
|
+
*/
|
|
55
|
+
clear(locales?: string | string[] | undefined): void;
|
|
56
|
+
private resolveLocales;
|
|
57
|
+
}
|
|
58
|
+
declare const i18n: I18nSingleton;
|
|
59
|
+
|
|
60
|
+
export { type FallbackBehavior as F, type I18nContext as I, type I18nConfig as a, i18n as i };
|