@astroscope/i18n 0.1.0 → 0.2.1
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 +23 -1
- package/dist/{chunk-FAKBSLNW.js → chunk-7MSGHEST.js} +14 -7
- package/dist/{chunk-JJEDOJBR.js → chunk-EO4FUQXR.js} +49 -18
- package/dist/{chunk-QFAAGCP5.js → chunk-RHWEV4L2.js} +58 -1
- package/dist/client/directives/idle.d.ts +4 -1
- package/dist/client/directives/idle.js +13 -6
- package/dist/client/directives/load.d.ts +4 -1
- package/dist/client/directives/load.js +6 -6
- package/dist/client/directives/media.d.ts +4 -1
- package/dist/client/directives/media.js +16 -6
- package/dist/client/directives/only.d.ts +6 -1
- package/dist/client/directives/only.js +6 -6
- package/dist/client/directives/utils.d.ts +6 -5
- package/dist/client/directives/utils.js +3 -3
- package/dist/client/directives/visible.d.ts +4 -1
- package/dist/client/directives/visible.js +23 -6
- package/dist/client/t.d.ts +2 -2
- package/dist/extraction/index.d.ts +3 -3
- package/dist/extraction/index.js +1 -1
- package/dist/{i18n-BGfrSNM8.d.ts → i18n-mTHTcD8K.d.ts} +9 -2
- package/dist/index.d.ts +26 -3
- package/dist/index.js +6 -2
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +1 -1
- package/dist/server/t.d.ts +1 -1
- package/dist/server/t.js +1 -1
- package/dist/{types-BaaSiz9n.d.ts → types-BeDFfFIL.d.ts} +1 -1
- package/dist/{types-Bzp6KxsI.d.ts → types-DNRFj1XA.d.ts} +1 -0
- package/dist/{types-DsNK_9sI.d.ts → types-DTUho6gi.d.ts} +7 -1
- package/package.json +8 -7
- package/src/components/I18nScript.astro +2 -23
- package/dist/babel-plugin-FUTQRKLT.js +0 -121
- package/dist/chunk-22ZZFFC2.js +0 -159
- package/dist/chunk-2PSXD3JJ.js +0 -144
- package/dist/chunk-3VI62RLT.js +0 -176
- package/dist/chunk-4DAQPWXI.js +0 -36
- package/dist/chunk-4OGX6AF5.js +0 -10
- package/dist/chunk-4PHYKXO3.js +0 -227
- package/dist/chunk-4UBFISFY.js +0 -376
- package/dist/chunk-5DERF6DV.js +0 -266
- package/dist/chunk-5KGNHFTC.js +0 -344
- package/dist/chunk-5PP4D2VK.js +0 -23
- package/dist/chunk-6BW3PN23.js +0 -14
- package/dist/chunk-6ESQ4JQI.js +0 -263
- package/dist/chunk-A7MPXMOP.js +0 -202
- package/dist/chunk-AWZ2SQDW.js +0 -149
- package/dist/chunk-AYY2YIBQ.js +0 -52
- package/dist/chunk-BMNEJFTD.js +0 -56
- package/dist/chunk-BSXQGEUK.js +0 -16
- package/dist/chunk-BSYTJFGF.js +0 -21
- package/dist/chunk-BVPXEGTT.js +0 -12
- package/dist/chunk-C4DJYWF6.js +0 -193
- package/dist/chunk-C5EJYE2P.js +0 -245
- package/dist/chunk-CLNOQHMS.js +0 -254
- package/dist/chunk-E5MCIRSU.js +0 -144
- package/dist/chunk-E7ZJS7WX.js +0 -162
- package/dist/chunk-ESFGCYYH.js +0 -24
- package/dist/chunk-FHBVI3TL.js +0 -372
- package/dist/chunk-FI5KZ5IO.js +0 -17
- package/dist/chunk-H5R6YMOL.js +0 -233
- package/dist/chunk-H62K3FGA.js +0 -236
- package/dist/chunk-HDG2R6XT.js +0 -211
- package/dist/chunk-HGXU5QAK.js +0 -344
- package/dist/chunk-HHRMR3TM.js +0 -17
- package/dist/chunk-HS4HVBAD.js +0 -127
- package/dist/chunk-IPJWKKHJ.js +0 -324
- package/dist/chunk-ITTL4V7J.js +0 -24
- package/dist/chunk-IWUBCMOK.js +0 -128
- package/dist/chunk-JJBBY2GR.js +0 -14
- package/dist/chunk-JTUKXNIJ.js +0 -23
- package/dist/chunk-K7YULG4A.js +0 -14
- package/dist/chunk-KNONI6DP.js +0 -89
- package/dist/chunk-LMTEO22Y.js +0 -17
- package/dist/chunk-LRLZEX4D.js +0 -147
- package/dist/chunk-MFKPLUAN.js +0 -241
- package/dist/chunk-MIWXQOO3.js +0 -316
- package/dist/chunk-MJRTAWPR.js +0 -261
- package/dist/chunk-MZEPQCXX.js +0 -249
- package/dist/chunk-NHHTSFA7.js +0 -237
- package/dist/chunk-NTTXM7AG.js +0 -23
- package/dist/chunk-NZFAVJXR.js +0 -192
- package/dist/chunk-OFNFSDW3.js +0 -13
- package/dist/chunk-PG3XDNGF.js +0 -227
- package/dist/chunk-PVEVTPNK.js +0 -139
- package/dist/chunk-QAO4BXS4.js +0 -244
- package/dist/chunk-QCTULQQK.js +0 -34
- package/dist/chunk-QKND2KCA.js +0 -163
- package/dist/chunk-QZEGY6RJ.js +0 -151
- package/dist/chunk-RAE2L6FT.js +0 -193
- package/dist/chunk-S3ABJBU3.js +0 -255
- package/dist/chunk-SVDVCPCV.js +0 -236
- package/dist/chunk-T35ZUWTL.js +0 -153
- package/dist/chunk-T6WV5DW6.js +0 -156
- package/dist/chunk-TGUXVDA3.js +0 -82
- package/dist/chunk-TYMO7K3A.js +0 -173
- package/dist/chunk-V4RBFLQL.js +0 -23
- package/dist/chunk-V4XWJXXZ.js +0 -23
- package/dist/chunk-VQCY3OKK.js +0 -258
- package/dist/chunk-WLGOJPDJ.js +0 -15
- package/dist/chunk-WUEPDJIL.js +0 -259
- package/dist/chunk-X3L7WZLY.js +0 -254
- package/dist/chunk-XDD62ZM3.js +0 -255
- package/dist/chunk-XFXXEDRD.js +0 -36
- package/dist/chunk-XKYOR5UK.js +0 -8
- package/dist/chunk-Y26535SI.js +0 -239
- package/dist/chunk-Y3PQX5TX.js +0 -152
- package/dist/chunk-Y4BE2V6F.js +0 -347
- package/dist/chunk-Z4IZYDIA.js +0 -24
- package/dist/chunk-Z52G4CYY.js +0 -14
- package/dist/chunk-ZGLUYWVM.js +0 -128
- package/dist/client/import-with-i18n.d.ts +0 -16
- package/dist/client/import-with-i18n.js +0 -8
- package/dist/client-directives/idle.d.ts +0 -9
- package/dist/client-directives/idle.js +0 -15
- package/dist/client-directives/load.d.ts +0 -9
- package/dist/client-directives/load.js +0 -15
- package/dist/client-directives/media.d.ts +0 -9
- package/dist/client-directives/media.js +0 -15
- package/dist/client-directives/only.d.ts +0 -9
- package/dist/client-directives/only.js +0 -15
- package/dist/client-directives/utils.d.ts +0 -9
- package/dist/client-directives/utils.js +0 -7
- package/dist/client-directives/visible.d.ts +0 -9
- package/dist/client-directives/visible.js +0 -15
- package/dist/i18n-3cZHoHwP.d.ts +0 -86
- package/dist/i18n-BHU81LMA.d.ts +0 -55
- package/dist/i18n-BagoeH4_.d.ts +0 -62
- package/dist/i18n-BeL84090.d.ts +0 -77
- package/dist/i18n-BeRWDfHi.d.ts +0 -55
- package/dist/i18n-Bfs2PVcf.d.ts +0 -79
- package/dist/i18n-BrL7p3aN.d.ts +0 -99
- package/dist/i18n-CNQNCFU0.d.ts +0 -55
- package/dist/i18n-CX_uU8V2.d.ts +0 -80
- package/dist/i18n-Cr1QZCwe.d.ts +0 -64
- package/dist/i18n-CzTRxGeX.d.ts +0 -80
- package/dist/i18n-DUOFiC7g.d.ts +0 -77
- package/dist/i18n-DcF47BHS.d.ts +0 -77
- package/dist/i18n-DifWvtaO.d.ts +0 -60
- package/dist/i18n-DumSqX1t.d.ts +0 -55
- package/dist/i18n-fWTJw12h.d.ts +0 -80
- package/dist/import-with-i18n.d.ts +0 -23
- package/dist/import-with-i18n.js +0 -7
- package/dist/init.d.ts +0 -2
- package/dist/init.js +0 -8
- package/dist/middleware-entrypoint-C0Drh9E_.d.ts +0 -29
- package/dist/middleware-entrypoint-mEl66IUy.d.ts +0 -29
- package/dist/middleware-entrypoint.d.ts +0 -5
- package/dist/middleware-entrypoint.js +0 -30
- package/dist/server/middleware-entrypoint.d.ts +0 -2
- package/dist/server/middleware-entrypoint.js +0 -28
- package/dist/t-BY_C9lZ1.d.ts +0 -30
- package/dist/t-CG3yDiEa.d.ts +0 -30
- package/dist/t-CHsBfrPr.d.ts +0 -30
- package/dist/t-DQpXaDhP.d.ts +0 -30
- package/dist/t.client.d.ts +0 -11
- package/dist/t.client.js +0 -35
- package/dist/t.server.d.ts +0 -22
- package/dist/t.server.js +0 -12
- package/dist/types-8uKCwFda.d.ts +0 -24
- package/dist/types-BC6K-pID.d.ts +0 -110
- package/dist/types-BUV7BZML.d.ts +0 -55
- package/dist/types-BWGB322F.d.ts +0 -46
- package/dist/types-B_-RxW4A.d.ts +0 -7
- package/dist/types-Bgl2V5xo.d.ts +0 -102
- package/dist/types-BwhB6IT4.d.ts +0 -111
- package/dist/types-C6rOJFY2.d.ts +0 -24
- package/dist/types-C7lD-Woj.d.ts +0 -50
- package/dist/types-CLWZeQhD.d.ts +0 -54
- package/dist/types-COXt613w.d.ts +0 -19
- package/dist/types-CUlkbl9-.d.ts +0 -50
- package/dist/types-CVv7GGPj.d.ts +0 -46
- package/dist/types-CiIDN2sW.d.ts +0 -64
- package/dist/types-Cr86qjYl.d.ts +0 -58
- package/dist/types-CxnObiEO.d.ts +0 -7
- package/dist/types-D44mFUjA.d.ts +0 -97
- package/dist/types-D85m9UTC.d.ts +0 -137
- package/dist/types-DWhsmSPP.d.ts +0 -102
- package/dist/types-DdprXGJ1.d.ts +0 -46
- package/dist/types-DhVJ2ZIo.d.ts +0 -43
- package/dist/types-DnbOuM1L.d.ts +0 -7
- package/dist/types-DvWBr9Xp.d.ts +0 -17
- package/dist/types-DwkIalh6.d.ts +0 -24
- package/dist/types-OYRgjtE_.d.ts +0 -110
- package/dist/types-SV8S05GX.d.ts +0 -7
- package/dist/types-TYn9WnxY.d.ts +0 -46
- package/dist/types-aXCBbdhq.d.ts +0 -55
- package/dist/types-gn4aNKGx.d.ts +0 -54
- package/dist/types-nippsMkm.d.ts +0 -54
package/dist/types-C7lD-Woj.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Variable definition for CMS/documentation
|
|
3
|
-
*/
|
|
4
|
-
type VariableDef = {
|
|
5
|
-
fallback?: string | undefined;
|
|
6
|
-
description?: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Metadata for a translation key - extracted at build time, synced to CMS
|
|
10
|
-
*/
|
|
11
|
-
type TranslationMeta = {
|
|
12
|
-
fallback: string;
|
|
13
|
-
variables?: Record<string, VariableDef> | undefined;
|
|
14
|
-
description?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Compiled translation ready for runtime use
|
|
18
|
-
*/
|
|
19
|
-
type CompiledTranslation = (values?: Record<string, unknown> | undefined) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Map of translation keys to compiled functions
|
|
22
|
-
*/
|
|
23
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
24
|
-
/**
|
|
25
|
-
* Raw translation strings from CMS (before compilation)
|
|
26
|
-
*/
|
|
27
|
-
type RawTranslations = Record<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Translate function signature
|
|
30
|
-
*
|
|
31
|
-
* @param key - Translation key (e.g., 'checkout.title')
|
|
32
|
-
* @param meta - Fallback string or full metadata object
|
|
33
|
-
* @param values - Runtime values for interpolation
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* t('checkout.title', 'Order Summary')
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* t('cart.items', '{count, plural, one {# item} other {# items}}', { count: itemCount })
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* t('cart.total', { fallback: 'Total: {amount}', description: 'Cart total' }, { amount: '$49.99' })
|
|
43
|
-
*/
|
|
44
|
-
type TranslateFunction = (key: string, meta: TranslationMeta | string, values?: Record<string, unknown> | undefined) => string;
|
|
45
|
-
/**
|
|
46
|
-
* Normalize meta argument to TranslationMeta object
|
|
47
|
-
*/
|
|
48
|
-
declare function normalizeMeta(meta: TranslationMeta | string): TranslationMeta;
|
|
49
|
-
|
|
50
|
-
export { type CompiledTranslations as C, type RawTranslations as R, type TranslateFunction as T, type VariableDef as V, type TranslationMeta as a, type CompiledTranslation as b, normalizeMeta as n };
|
package/dist/types-CLWZeQhD.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Variable definition for documentation
|
|
3
|
-
*/
|
|
4
|
-
type VariableDef = {
|
|
5
|
-
fallback?: string | undefined;
|
|
6
|
-
description?: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Metadata for a translation key - extracted at build time
|
|
10
|
-
*/
|
|
11
|
-
type TranslationMeta = {
|
|
12
|
-
fallback: string;
|
|
13
|
-
variables?: Record<string, VariableDef> | undefined;
|
|
14
|
-
description?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Compiled translation ready for runtime use
|
|
18
|
-
*/
|
|
19
|
-
type CompiledTranslation = (values?: Record<string, unknown> | undefined) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Map of translation keys to compiled functions
|
|
22
|
-
*/
|
|
23
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
24
|
-
/**
|
|
25
|
-
* Raw translation strings (before compilation)
|
|
26
|
-
*/
|
|
27
|
-
type RawTranslations = Record<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Client-side i18n state injected into window.__i18n__
|
|
30
|
-
*/
|
|
31
|
-
type I18nClientState = {
|
|
32
|
-
locale: string;
|
|
33
|
-
hashes: Record<string, string>;
|
|
34
|
-
translations: Record<string, string>;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Translate function signature
|
|
38
|
-
*
|
|
39
|
-
* @param key - Translation key (e.g., 'checkout.title')
|
|
40
|
-
* @param meta - Fallback string or full metadata object
|
|
41
|
-
* @param values - Runtime values for interpolation
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* t('checkout.title', 'Order Summary')
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* t('cart.items', '{count, plural, one {# item} other {# items}}', { count: itemCount })
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* t('cart.total', { fallback: 'Total: {amount}', description: 'Cart total' }, { amount: '$49.99' })
|
|
51
|
-
*/
|
|
52
|
-
type TranslateFunction = (key: string, meta: TranslationMeta | string, values?: Record<string, unknown> | undefined) => string;
|
|
53
|
-
|
|
54
|
-
export type { CompiledTranslations as C, I18nClientState as I, RawTranslations as R, TranslateFunction as T, TranslationMeta as a };
|
package/dist/types-COXt613w.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type I18nClientState = {
|
|
2
|
-
/**
|
|
3
|
-
* Current locale
|
|
4
|
-
*/
|
|
5
|
-
locale: string;
|
|
6
|
-
/**
|
|
7
|
-
* Mapping of chunk keys to the translation content hash
|
|
8
|
-
*/
|
|
9
|
-
hashes: Record<string, string>;
|
|
10
|
-
/**
|
|
11
|
-
* Mapping of loaded translation keys to translated strings
|
|
12
|
-
*/
|
|
13
|
-
translations: Record<string, string>;
|
|
14
|
-
};
|
|
15
|
-
declare global {
|
|
16
|
-
interface Window {
|
|
17
|
-
__i18n__: I18nClientState;
|
|
18
|
-
}
|
|
19
|
-
}
|
package/dist/types-CUlkbl9-.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Variable definition for CMS/documentation
|
|
3
|
-
*/
|
|
4
|
-
type VariableDef = {
|
|
5
|
-
fallback?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Metadata for a translation key - extracted at build time, synced to CMS
|
|
10
|
-
*/
|
|
11
|
-
type TranslationMeta = {
|
|
12
|
-
fallback: string;
|
|
13
|
-
variables?: Record<string, VariableDef>;
|
|
14
|
-
description?: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Compiled translation ready for runtime use
|
|
18
|
-
*/
|
|
19
|
-
type CompiledTranslation = (values?: Record<string, unknown>) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Map of translation keys to compiled functions
|
|
22
|
-
*/
|
|
23
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
24
|
-
/**
|
|
25
|
-
* Raw translation strings from CMS (before compilation)
|
|
26
|
-
*/
|
|
27
|
-
type RawTranslations = Record<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Translate function signature
|
|
30
|
-
*
|
|
31
|
-
* @param key - Translation key (e.g., 'checkout.title')
|
|
32
|
-
* @param meta - Fallback string or full metadata object
|
|
33
|
-
* @param values - Runtime values for interpolation
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* t('checkout.title', 'Order Summary')
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* t('cart.items', '{count, plural, one {# item} other {# items}}', { count: itemCount })
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* t('cart.total', { fallback: 'Total: {amount}', description: 'Cart total' }, { amount: '$49.99' })
|
|
43
|
-
*/
|
|
44
|
-
type TranslateFunction = (key: string, meta: TranslationMeta | string, values?: Record<string, unknown>) => string;
|
|
45
|
-
/**
|
|
46
|
-
* Normalize meta argument to TranslationMeta object
|
|
47
|
-
*/
|
|
48
|
-
declare function normalizeMeta(meta: TranslationMeta | string): TranslationMeta;
|
|
49
|
-
|
|
50
|
-
export { type CompiledTranslations as C, type RawTranslations as R, type TranslateFunction as T, type VariableDef as V, type TranslationMeta as a, type CompiledTranslation as b, normalizeMeta as n };
|
package/dist/types-CVv7GGPj.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Variable definition for CMS/documentation
|
|
3
|
-
*/
|
|
4
|
-
type VariableDef = {
|
|
5
|
-
fallback?: string | undefined;
|
|
6
|
-
description?: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Metadata for a translation key - extracted at build time, synced to CMS
|
|
10
|
-
*/
|
|
11
|
-
type TranslationMeta = {
|
|
12
|
-
fallback: string;
|
|
13
|
-
variables?: Record<string, VariableDef> | undefined;
|
|
14
|
-
description?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Compiled translation ready for runtime use
|
|
18
|
-
*/
|
|
19
|
-
type CompiledTranslation = (values?: Record<string, unknown> | undefined) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Map of translation keys to compiled functions
|
|
22
|
-
*/
|
|
23
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
24
|
-
/**
|
|
25
|
-
* Raw translation strings from CMS (before compilation)
|
|
26
|
-
*/
|
|
27
|
-
type RawTranslations = Record<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Translate function signature
|
|
30
|
-
*
|
|
31
|
-
* @param key - Translation key (e.g., 'checkout.title')
|
|
32
|
-
* @param meta - Fallback string or full metadata object
|
|
33
|
-
* @param values - Runtime values for interpolation
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* t('checkout.title', 'Order Summary')
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* t('cart.items', '{count, plural, one {# item} other {# items}}', { count: itemCount })
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* t('cart.total', { fallback: 'Total: {amount}', description: 'Cart total' }, { amount: '$49.99' })
|
|
43
|
-
*/
|
|
44
|
-
type TranslateFunction = (key: string, meta: TranslationMeta | string, values?: Record<string, unknown> | undefined) => string;
|
|
45
|
-
|
|
46
|
-
export type { CompiledTranslations as C, RawTranslations as R, TranslationMeta as T, TranslateFunction as a };
|
package/dist/types-CiIDN2sW.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Variable definition for documentation
|
|
3
|
-
*/
|
|
4
|
-
type VariableDef = {
|
|
5
|
-
fallback?: string | undefined;
|
|
6
|
-
description?: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Metadata for a translation key - extracted at build time
|
|
10
|
-
*/
|
|
11
|
-
type TranslationMeta = {
|
|
12
|
-
fallback: string;
|
|
13
|
-
variables?: Record<string, VariableDef> | undefined;
|
|
14
|
-
description?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Compiled translation ready for runtime use
|
|
18
|
-
*/
|
|
19
|
-
type CompiledTranslation = (values?: Record<string, unknown> | undefined) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Map of translation keys to compiled functions
|
|
22
|
-
*/
|
|
23
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
24
|
-
/**
|
|
25
|
-
* Raw translation strings (before compilation)
|
|
26
|
-
*/
|
|
27
|
-
type RawTranslations = Record<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Client-side i18n state injected into window.__i18n__
|
|
30
|
-
*/
|
|
31
|
-
type I18nClientState = {
|
|
32
|
-
locale: string;
|
|
33
|
-
hashes: Record<string, string>;
|
|
34
|
-
translations: Record<string, string>;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Translate function signature
|
|
38
|
-
*
|
|
39
|
-
* In development, the second argument is required (fallback string or meta object).
|
|
40
|
-
* In production, fallbacks are stripped by the Babel plugin, so the second argument
|
|
41
|
-
* becomes optional or contains only interpolation values.
|
|
42
|
-
*
|
|
43
|
-
* @param key - Translation key (e.g., 'checkout.title')
|
|
44
|
-
* @param metaOrValues - Fallback string, meta object, or interpolation values (production)
|
|
45
|
-
* @param values - Runtime values for interpolation (when meta is provided)
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* // Development (with fallback)
|
|
49
|
-
* t('checkout.title', 'Order Summary')
|
|
50
|
-
* t('cart.items', '{count, plural, one {# item} other {# items}}', { count: itemCount })
|
|
51
|
-
* t('cart.total', { fallback: 'Total: {amount}' }, { amount: '$49.99' })
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* // Production (fallbacks stripped)
|
|
55
|
-
* t('checkout.title')
|
|
56
|
-
* t('cart.items', { count: itemCount })
|
|
57
|
-
* t('cart.total', { amount: '$49.99' })
|
|
58
|
-
*/
|
|
59
|
-
type TranslateFunction = {
|
|
60
|
-
(key: string, meta: TranslationMeta | string, values?: Record<string, unknown> | undefined): string;
|
|
61
|
-
(key: string, values?: Record<string, unknown> | undefined): string;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export type { CompiledTranslations as C, I18nClientState as I, RawTranslations as R, TranslationMeta as T, TranslateFunction as a };
|
package/dist/types-Cr86qjYl.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared types used by both server and client
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Variable definition with optional example for CMS/documentation
|
|
6
|
-
*/
|
|
7
|
-
type VariableDef = {
|
|
8
|
-
example?: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Metadata for a translation key - extracted at build time, synced to CMS
|
|
13
|
-
*/
|
|
14
|
-
type TranslationMeta = {
|
|
15
|
-
example: string;
|
|
16
|
-
variables?: Record<string, VariableDef>;
|
|
17
|
-
description?: string;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Compiled translation ready for runtime use
|
|
21
|
-
*/
|
|
22
|
-
type CompiledTranslation = (values?: Record<string, unknown>) => string;
|
|
23
|
-
/**
|
|
24
|
-
* Map of translation keys to compiled functions
|
|
25
|
-
*/
|
|
26
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
27
|
-
/**
|
|
28
|
-
* Raw translation strings from CMS (before compilation)
|
|
29
|
-
*/
|
|
30
|
-
type RawTranslations = Record<string, string>;
|
|
31
|
-
/**
|
|
32
|
-
* Translate function signature
|
|
33
|
-
*
|
|
34
|
-
* @param key - Translation key (e.g., 'checkout.title')
|
|
35
|
-
* @param meta - Metadata with example and variable definitions (extracted at build time)
|
|
36
|
-
* @param values - Runtime values for interpolation
|
|
37
|
-
* @returns Translated string
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* // Simple
|
|
41
|
-
* t('checkout.title', { example: 'Bestellübersicht' })
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* // With variables
|
|
45
|
-
* t('checkout.tax', {
|
|
46
|
-
* example: 'Enthält {name} MwSt.',
|
|
47
|
-
* variables: { name: { example: '19%' } }
|
|
48
|
-
* }, { name: taxRate })
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* // Pluralization (ICU)
|
|
52
|
-
* t('cart.items', {
|
|
53
|
-
* example: '{count, plural, one {# item} other {# items}}'
|
|
54
|
-
* }, { count: itemCount })
|
|
55
|
-
*/
|
|
56
|
-
type TranslateFunction = (key: string, meta: TranslationMeta, values?: Record<string, unknown>) => string;
|
|
57
|
-
|
|
58
|
-
export type { CompiledTranslations as C, RawTranslations as R, TranslationMeta as T, VariableDef as V, CompiledTranslation as a, TranslateFunction as b };
|
package/dist/types-CxnObiEO.d.ts
DELETED
package/dist/types-D44mFUjA.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Variable definition with optional example for CMS/documentation
|
|
3
|
-
*/
|
|
4
|
-
type VariableDef = {
|
|
5
|
-
example?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Metadata for a translation key - extracted at build time, synced to CMS
|
|
10
|
-
*/
|
|
11
|
-
type TranslationMeta = {
|
|
12
|
-
example: string;
|
|
13
|
-
variables?: Record<string, VariableDef>;
|
|
14
|
-
description?: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Compiled translation ready for runtime use
|
|
18
|
-
*/
|
|
19
|
-
type CompiledTranslation = (values?: Record<string, unknown>) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Map of translation keys to compiled functions
|
|
22
|
-
*/
|
|
23
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
24
|
-
/**
|
|
25
|
-
* Raw translation strings from CMS (before compilation)
|
|
26
|
-
*/
|
|
27
|
-
type RawTranslations = Record<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Extracted metadata for a single translation key
|
|
30
|
-
*/
|
|
31
|
-
type ExtractedKey = {
|
|
32
|
-
key: string;
|
|
33
|
-
meta: TranslationMeta;
|
|
34
|
-
file: string;
|
|
35
|
-
line: number;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Chunk-to-keys mapping produced by Vite plugin
|
|
39
|
-
*/
|
|
40
|
-
type ChunkManifest = Record<string, string[]>;
|
|
41
|
-
/**
|
|
42
|
-
* Full extraction manifest
|
|
43
|
-
*/
|
|
44
|
-
type ExtractionManifest = {
|
|
45
|
-
keys: ExtractedKey[];
|
|
46
|
-
chunks: ChunkManifest;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Fallback behavior when translation is missing
|
|
50
|
-
*/
|
|
51
|
-
type FallbackBehavior = 'key' | 'example' | 'throw' | ((key: string, meta?: TranslationMeta) => string);
|
|
52
|
-
/**
|
|
53
|
-
* CMS adapter interface
|
|
54
|
-
*/
|
|
55
|
-
type CmsAdapter = {
|
|
56
|
-
/**
|
|
57
|
-
* Fetch translations for given locale and keys
|
|
58
|
-
*/
|
|
59
|
-
fetch: (locale: string, keys: string[]) => Promise<RawTranslations>;
|
|
60
|
-
/**
|
|
61
|
-
* Sync extracted keys to CMS (push metadata)
|
|
62
|
-
*/
|
|
63
|
-
sync?: (manifest: ExtractionManifest) => Promise<void>;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* User's i18n.ts exports
|
|
67
|
-
*/
|
|
68
|
-
type I18nUserConfig = {
|
|
69
|
-
/**
|
|
70
|
-
* CMS adapter for fetching/syncing translations
|
|
71
|
-
*/
|
|
72
|
-
cms: CmsAdapter;
|
|
73
|
-
/**
|
|
74
|
-
* Optional chunk manifest for per-chunk loading
|
|
75
|
-
* In production, this should be loaded from build output
|
|
76
|
-
*/
|
|
77
|
-
chunkManifest?: ChunkManifest;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Request-scoped i18n context
|
|
81
|
-
*/
|
|
82
|
-
type I18nContext = {
|
|
83
|
-
locale: string;
|
|
84
|
-
translations: CompiledTranslations;
|
|
85
|
-
fallback: FallbackBehavior;
|
|
86
|
-
meta: Record<string, TranslationMeta>;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Global i18n config (from virtual module)
|
|
90
|
-
*/
|
|
91
|
-
type I18nConfig = {
|
|
92
|
-
locales: string[];
|
|
93
|
-
defaultLocale: string;
|
|
94
|
-
fallback: FallbackBehavior;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export type { CmsAdapter as C, ExtractedKey as E, FallbackBehavior as F, I18nUserConfig as I, RawTranslations as R, TranslationMeta as T, VariableDef as V, ChunkManifest as a, CompiledTranslation as b, CompiledTranslations as c, ExtractionManifest as d, I18nContext as e, I18nConfig as f };
|
package/dist/types-D85m9UTC.d.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Variable definition with optional example for CMS/documentation
|
|
3
|
-
*/
|
|
4
|
-
type VariableDef = {
|
|
5
|
-
example?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Metadata for a translation key - extracted at build time, synced to CMS
|
|
10
|
-
*/
|
|
11
|
-
type TranslationMeta = {
|
|
12
|
-
example: string;
|
|
13
|
-
variables?: Record<string, VariableDef>;
|
|
14
|
-
description?: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Compiled translation ready for runtime use
|
|
18
|
-
*/
|
|
19
|
-
type CompiledTranslation = (values?: Record<string, unknown>) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Map of translation keys to compiled functions
|
|
22
|
-
*/
|
|
23
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
24
|
-
/**
|
|
25
|
-
* Raw translation strings from CMS (before compilation)
|
|
26
|
-
*/
|
|
27
|
-
type RawTranslations = Record<string, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Extracted metadata for a single translation key
|
|
30
|
-
*/
|
|
31
|
-
type ExtractedKey = {
|
|
32
|
-
key: string;
|
|
33
|
-
meta: TranslationMeta;
|
|
34
|
-
file: string;
|
|
35
|
-
line: number;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Chunk-to-keys mapping produced by Vite plugin
|
|
39
|
-
*/
|
|
40
|
-
type ChunkManifest = Record<string, string[]>;
|
|
41
|
-
/**
|
|
42
|
-
* Full extraction manifest
|
|
43
|
-
*/
|
|
44
|
-
type ExtractionManifest = {
|
|
45
|
-
keys: ExtractedKey[];
|
|
46
|
-
chunks: ChunkManifest;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Fallback behavior when translation is missing
|
|
50
|
-
*/
|
|
51
|
-
type FallbackBehavior = 'key' | 'example' | 'throw' | ((key: string, meta?: TranslationMeta) => string);
|
|
52
|
-
/**
|
|
53
|
-
* CMS adapter interface
|
|
54
|
-
*/
|
|
55
|
-
type CmsAdapter = {
|
|
56
|
-
/**
|
|
57
|
-
* Fetch translations for given locale and keys
|
|
58
|
-
*/
|
|
59
|
-
fetch: (locale: string, keys: string[]) => Promise<RawTranslations>;
|
|
60
|
-
/**
|
|
61
|
-
* Sync extracted keys to CMS (push metadata)
|
|
62
|
-
*/
|
|
63
|
-
sync?: (manifest: ExtractionManifest) => Promise<void>;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* User's i18n.ts exports
|
|
67
|
-
*/
|
|
68
|
-
type I18nUserConfig = {
|
|
69
|
-
/**
|
|
70
|
-
* CMS adapter for fetching/syncing translations
|
|
71
|
-
*/
|
|
72
|
-
cms: CmsAdapter;
|
|
73
|
-
/**
|
|
74
|
-
* Optional chunk manifest for per-chunk loading
|
|
75
|
-
* In production, this should be loaded from build output
|
|
76
|
-
*/
|
|
77
|
-
chunkManifest?: ChunkManifest;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Request-scoped i18n context
|
|
81
|
-
*/
|
|
82
|
-
type I18nContext = {
|
|
83
|
-
locale: string;
|
|
84
|
-
translations: CompiledTranslations;
|
|
85
|
-
fallback: FallbackBehavior;
|
|
86
|
-
meta: Record<string, TranslationMeta>;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Global i18n config (from virtual module)
|
|
90
|
-
*/
|
|
91
|
-
type I18nConfig = {
|
|
92
|
-
locales: string[];
|
|
93
|
-
defaultLocale: string;
|
|
94
|
-
fallback: FallbackBehavior;
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Client-side i18n state stored on window.__i18n__
|
|
98
|
-
* Fallback is handled server-side; client just uses example from t() call if missing
|
|
99
|
-
*/
|
|
100
|
-
type I18nClientState = {
|
|
101
|
-
locale: string;
|
|
102
|
-
hashes: Record<string, string>;
|
|
103
|
-
translations: Record<string, string>;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Translate function signature
|
|
107
|
-
*
|
|
108
|
-
* @param key - Translation key (e.g., 'checkout.title')
|
|
109
|
-
* @param meta - Metadata with example and variable definitions (extracted at build time)
|
|
110
|
-
* @param values - Runtime values for interpolation
|
|
111
|
-
* @returns Translated string
|
|
112
|
-
*
|
|
113
|
-
* @example
|
|
114
|
-
* // Simple
|
|
115
|
-
* t('checkout.title', { example: 'Bestellübersicht' })
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* // With variables
|
|
119
|
-
* t('checkout.tax', {
|
|
120
|
-
* example: 'Enthält {name} MwSt.',
|
|
121
|
-
* variables: { name: { example: '19%' } }
|
|
122
|
-
* }, { name: taxRate })
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* // Pluralization (ICU)
|
|
126
|
-
* t('cart.items', {
|
|
127
|
-
* example: '{count, plural, one {# item} other {# items}}'
|
|
128
|
-
* }, { count: itemCount })
|
|
129
|
-
*/
|
|
130
|
-
type TranslateFunction = (key: string, meta: TranslationMeta, values?: Record<string, unknown>) => string;
|
|
131
|
-
declare global {
|
|
132
|
-
interface Window {
|
|
133
|
-
__i18n__?: I18nClientState;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export type { CmsAdapter as C, ExtractedKey as E, FallbackBehavior as F, I18nUserConfig as I, RawTranslations as R, TranslationMeta as T, VariableDef as V, ChunkManifest as a, CompiledTranslation as b, CompiledTranslations as c, ExtractionManifest as d, I18nContext as e, I18nConfig as f, TranslateFunction as g };
|
package/dist/types-DWhsmSPP.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface Window {
|
|
3
|
-
__i18n__: I18nClientState;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Variable definition with optional example for CMS/documentation
|
|
8
|
-
*/
|
|
9
|
-
type VariableDef = {
|
|
10
|
-
example?: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Metadata for a translation key - extracted at build time, synced to CMS
|
|
15
|
-
*/
|
|
16
|
-
type TranslationMeta = {
|
|
17
|
-
example: string;
|
|
18
|
-
variables?: Record<string, VariableDef>;
|
|
19
|
-
description?: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Compiled translation ready for runtime use
|
|
23
|
-
*/
|
|
24
|
-
type CompiledTranslation = (values?: Record<string, unknown>) => string;
|
|
25
|
-
/**
|
|
26
|
-
* Map of translation keys to compiled functions
|
|
27
|
-
*/
|
|
28
|
-
type CompiledTranslations = Record<string, CompiledTranslation>;
|
|
29
|
-
/**
|
|
30
|
-
* Raw translation strings from CMS (before compilation)
|
|
31
|
-
*/
|
|
32
|
-
type RawTranslations = Record<string, string>;
|
|
33
|
-
/**
|
|
34
|
-
* Extracted metadata for a single translation key
|
|
35
|
-
*/
|
|
36
|
-
type ExtractedKey = {
|
|
37
|
-
key: string;
|
|
38
|
-
meta: TranslationMeta;
|
|
39
|
-
file: string;
|
|
40
|
-
line: number;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Chunk-to-keys mapping produced by Vite plugin
|
|
44
|
-
*/
|
|
45
|
-
type ChunkManifest = Record<string, string[]>;
|
|
46
|
-
/**
|
|
47
|
-
* Full extraction manifest
|
|
48
|
-
*/
|
|
49
|
-
type ExtractionManifest = {
|
|
50
|
-
keys: ExtractedKey[];
|
|
51
|
-
chunks: ChunkManifest;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Fallback behavior when translation is missing
|
|
55
|
-
*/
|
|
56
|
-
type FallbackBehavior = 'key' | 'example' | 'throw' | ((key: string, meta?: TranslationMeta) => string);
|
|
57
|
-
/**
|
|
58
|
-
* Request-scoped i18n context
|
|
59
|
-
*/
|
|
60
|
-
type I18nContext = {
|
|
61
|
-
locale: string;
|
|
62
|
-
translations: CompiledTranslations;
|
|
63
|
-
fallback: FallbackBehavior;
|
|
64
|
-
meta: Record<string, TranslationMeta>;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Client-side i18n state stored on window.__i18n__
|
|
68
|
-
* Fallback is handled server-side; client just uses example from t() call if missing
|
|
69
|
-
*/
|
|
70
|
-
type I18nClientState = {
|
|
71
|
-
locale: string;
|
|
72
|
-
hashes: Record<string, string>;
|
|
73
|
-
translations: Record<string, string>;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Translate function signature
|
|
77
|
-
*
|
|
78
|
-
* @param key - Translation key (e.g., 'checkout.title')
|
|
79
|
-
* @param meta - Metadata with example and variable definitions (extracted at build time)
|
|
80
|
-
* @param values - Runtime values for interpolation
|
|
81
|
-
* @returns Translated string
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* // Simple
|
|
85
|
-
* t('checkout.title', { example: 'Bestellübersicht' })
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* // With variables
|
|
89
|
-
* t('checkout.tax', {
|
|
90
|
-
* example: 'Enthält {name} MwSt.',
|
|
91
|
-
* variables: { name: { example: '19%' } }
|
|
92
|
-
* }, { name: taxRate })
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* // Pluralization (ICU)
|
|
96
|
-
* t('cart.items', {
|
|
97
|
-
* example: '{count, plural, one {# item} other {# items}}'
|
|
98
|
-
* }, { count: itemCount })
|
|
99
|
-
*/
|
|
100
|
-
type TranslateFunction = (key: string, meta: TranslationMeta, values?: Record<string, unknown>) => string;
|
|
101
|
-
|
|
102
|
-
export type { ChunkManifest as C, ExtractedKey as E, FallbackBehavior as F, I18nContext as I, RawTranslations as R, TranslationMeta as T, VariableDef as V, CompiledTranslations as a, CompiledTranslation as b, ExtractionManifest as c, TranslateFunction as d };
|