intlayer 2.0.13 → 3.0.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 +38 -34
- package/dist/cjs/index.cjs +6 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +11 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +28 -19
- package/dist/cjs/index.d.ts +0 -13
- package/dist/esm/index.d.mts +0 -13
package/README.md
CHANGED
|
@@ -38,14 +38,16 @@
|
|
|
38
38
|
|
|
39
39
|
import { DeclarationContent, t } from "intlayer";
|
|
40
40
|
|
|
41
|
-
const clientComponentContent
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
41
|
+
const clientComponentContent = {
|
|
42
|
+
key: "client-component",
|
|
43
|
+
content: {
|
|
44
|
+
myTranslatedContent: t({
|
|
45
|
+
en: "Hello World",
|
|
46
|
+
fr: "Bonjour le monde",
|
|
47
|
+
es: "Hola Mundo",
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
} satisfies DeclarationContent;
|
|
49
51
|
|
|
50
52
|
export default clientComponentContent;
|
|
51
53
|
```
|
|
@@ -73,12 +75,12 @@ export const ClientComponent = () => {
|
|
|
73
75
|
|
|
74
76
|
`intlayer` package intend to declare your content in a structured way, using JavaScript.
|
|
75
77
|
|
|
76
|
-
To build dictionaries from this declaration, you can use [intlayer-cli](https://github.com/
|
|
77
|
-
And to interpret intlayer dictionaries you can interpreters, such as [react-intlayer](https://github.com/
|
|
78
|
+
To build dictionaries from this declaration, you can use [intlayer-cli](https://github.com/aymericzip/intlayer/blob/main/packages/intlayer-cli/readme_en.md).
|
|
79
|
+
And to interpret intlayer dictionaries you can interpreters, such as [react-intlayer](https://github.com/aymericzip/intlayer/blob/main/packages/react-intlayer/readme_en.md), or [next-intlayer](https://github.com/aymericzip/intlayer/blob/main/packages/next-intlayer/readme_en.md)
|
|
78
80
|
|
|
79
81
|
## Getting Started with Intlayer
|
|
80
82
|
|
|
81
|
-
[See how to use intlayer with NextJS](https://github.com/
|
|
83
|
+
[See how to use intlayer with NextJS](https://github.com/aymericzip/intlayer/blob/main/readme_en.md)
|
|
82
84
|
|
|
83
85
|
### Install Package
|
|
84
86
|
|
|
@@ -89,11 +91,11 @@ npm install intlayer
|
|
|
89
91
|
```
|
|
90
92
|
|
|
91
93
|
```bash
|
|
92
|
-
yarn
|
|
94
|
+
yarn add intlayer
|
|
93
95
|
```
|
|
94
96
|
|
|
95
97
|
```bash
|
|
96
|
-
pnpm
|
|
98
|
+
pnpm add intlayer
|
|
97
99
|
```
|
|
98
100
|
|
|
99
101
|
### Manage Your Content
|
|
@@ -106,28 +108,30 @@ Create and manage your content dictionaries:
|
|
|
106
108
|
// src/app/[locale]/page.content.ts
|
|
107
109
|
import { t, enu, type DeclarationContent } from "intlayer";
|
|
108
110
|
|
|
109
|
-
const pageContent
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
111
|
+
const pageContent = {
|
|
112
|
+
key: "page",
|
|
113
|
+
content: {
|
|
114
|
+
getStarted: {
|
|
115
|
+
main: t({
|
|
116
|
+
en: "Get started by editing",
|
|
117
|
+
fr: "Commencez par éditer",
|
|
118
|
+
es: "Comience por editar",
|
|
119
|
+
}),
|
|
120
|
+
pageLink: "src/app/page.tsx",
|
|
121
|
+
},
|
|
122
|
+
nestedContent: {
|
|
123
|
+
id: "enumeration",
|
|
124
|
+
numberOfCar: enu({
|
|
125
|
+
"<-1": "Less than minus one car",
|
|
126
|
+
"-1": "Minus one car",
|
|
127
|
+
"0": "No cars",
|
|
128
|
+
"1": "One car",
|
|
129
|
+
">5": "Some cars",
|
|
130
|
+
">19": "Many cars",
|
|
131
|
+
}),
|
|
132
|
+
},
|
|
129
133
|
},
|
|
130
|
-
};
|
|
134
|
+
} satisfies DeclarationContent;
|
|
131
135
|
|
|
132
136
|
// Content should be exported as default
|
|
133
137
|
export default pageContent;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -21,8 +21,11 @@ __export(src_exports, {
|
|
|
21
21
|
Locales: () => import_client.Locales,
|
|
22
22
|
enu: () => import_core2.enu,
|
|
23
23
|
getEnumerationContent: () => import_core2.getEnumerationContent,
|
|
24
|
+
getHTMLLang: () => import_core2.getHTMLLang,
|
|
25
|
+
getHTMLTextDir: () => import_core2.getHTMLTextDir,
|
|
24
26
|
getLocaleName: () => import_core2.getLocaleName,
|
|
25
27
|
getTranslationContent: () => getTranslationContent,
|
|
28
|
+
localeList: () => import_core2.localeList,
|
|
26
29
|
t: () => t
|
|
27
30
|
});
|
|
28
31
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -36,8 +39,11 @@ const getTranslationContent = import_core.getTranslationContent;
|
|
|
36
39
|
Locales,
|
|
37
40
|
enu,
|
|
38
41
|
getEnumerationContent,
|
|
42
|
+
getHTMLLang,
|
|
43
|
+
getHTMLTextDir,
|
|
39
44
|
getLocaleName,
|
|
40
45
|
getTranslationContent,
|
|
46
|
+
localeList,
|
|
41
47
|
t
|
|
42
48
|
});
|
|
43
49
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\nimport {\n type TranslationContent,\n t as tCore,\n getTranslationContent as getTranslationContentCore,\n type LanguageContent,\n} from '@intlayer/core';\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nexport interface IConfigLocales<Content> {\n // This interface should be augmented in the consuming app\n}\n\ntype ConfigLocales = keyof IConfigLocales<unknown>;\n\nexport type CustomizableLanguageContent<Content = string> =\n ConfigLocales extends never\n ? LanguageContent<Content>\n : IConfigLocales<Content>;\n\n// Re-exporting the following functions from the core package: to use module augmentation\nexport const t: <Content = string>(\n content?: CustomizableLanguageContent<Content>\n) => TranslationContent<Content> = tCore;\nexport const getTranslationContent: <Content = string>(\n languageContent: CustomizableLanguageContent<Content>,\n locale: Locales\n) => Content = getTranslationContentCore;\n\nexport type {\n LanguageContent,\n QuantityContent,\n ContentValue,\n DeclarationContent,\n} from '@intlayer/core';\nexport {
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\nimport {\n type TranslationContent,\n t as tCore,\n getTranslationContent as getTranslationContentCore,\n type LanguageContent,\n} from '@intlayer/core';\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nexport interface IConfigLocales<Content> {\n // This interface should be augmented in the consuming app\n}\n\ntype ConfigLocales = keyof IConfigLocales<unknown>;\n\nexport type CustomizableLanguageContent<Content = string> =\n ConfigLocales extends never\n ? LanguageContent<Content>\n : IConfigLocales<Content>;\n\n// Re-exporting the following functions from the core package: to use module augmentation\nexport const t: <Content = string>(\n content?: CustomizableLanguageContent<Content>\n) => TranslationContent<Content> = tCore;\nexport const getTranslationContent: <Content = string>(\n languageContent: CustomizableLanguageContent<Content>,\n locale: Locales\n) => Content = getTranslationContentCore;\n\nexport type {\n LanguageContent,\n QuantityContent,\n ContentValue,\n DeclarationContent,\n} from '@intlayer/core';\nexport {\n getLocaleName,\n enu,\n getEnumerationContent,\n getHTMLLang,\n getHTMLTextDir,\n localeList,\n} from '@intlayer/core';\nexport type {\n LocalesValues,\n CustomIntlayerConfig as IntlayerConfig,\n} from '@intlayer/config/client';\nexport { Locales } from '@intlayer/config/client';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAKO;AA8BP,IAAAA,eAOO;AAKP,oBAAwB;AA1BjB,MAAM,IAEsB,YAAAC;AAC5B,MAAM,wBAGE,YAAAC;","names":["import_core","tCore","getTranslationContentCore"]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -4,14 +4,24 @@ import {
|
|
|
4
4
|
} from "@intlayer/core";
|
|
5
5
|
const t = tCore;
|
|
6
6
|
const getTranslationContent = getTranslationContentCore;
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
getLocaleName,
|
|
9
|
+
enu,
|
|
10
|
+
getEnumerationContent,
|
|
11
|
+
getHTMLLang,
|
|
12
|
+
getHTMLTextDir,
|
|
13
|
+
localeList
|
|
14
|
+
} from "@intlayer/core";
|
|
8
15
|
import { Locales } from "@intlayer/config/client";
|
|
9
16
|
export {
|
|
10
17
|
Locales,
|
|
11
18
|
enu,
|
|
12
19
|
getEnumerationContent,
|
|
20
|
+
getHTMLLang,
|
|
21
|
+
getHTMLTextDir,
|
|
13
22
|
getLocaleName,
|
|
14
23
|
getTranslationContent,
|
|
24
|
+
localeList,
|
|
15
25
|
t
|
|
16
26
|
};
|
|
17
27
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\nimport {\n type TranslationContent,\n t as tCore,\n getTranslationContent as getTranslationContentCore,\n type LanguageContent,\n} from '@intlayer/core';\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nexport interface IConfigLocales<Content> {\n // This interface should be augmented in the consuming app\n}\n\ntype ConfigLocales = keyof IConfigLocales<unknown>;\n\nexport type CustomizableLanguageContent<Content = string> =\n ConfigLocales extends never\n ? LanguageContent<Content>\n : IConfigLocales<Content>;\n\n// Re-exporting the following functions from the core package: to use module augmentation\nexport const t: <Content = string>(\n content?: CustomizableLanguageContent<Content>\n) => TranslationContent<Content> = tCore;\nexport const getTranslationContent: <Content = string>(\n languageContent: CustomizableLanguageContent<Content>,\n locale: Locales\n) => Content = getTranslationContentCore;\n\nexport type {\n LanguageContent,\n QuantityContent,\n ContentValue,\n DeclarationContent,\n} from '@intlayer/core';\nexport {
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\nimport {\n type TranslationContent,\n t as tCore,\n getTranslationContent as getTranslationContentCore,\n type LanguageContent,\n} from '@intlayer/core';\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nexport interface IConfigLocales<Content> {\n // This interface should be augmented in the consuming app\n}\n\ntype ConfigLocales = keyof IConfigLocales<unknown>;\n\nexport type CustomizableLanguageContent<Content = string> =\n ConfigLocales extends never\n ? LanguageContent<Content>\n : IConfigLocales<Content>;\n\n// Re-exporting the following functions from the core package: to use module augmentation\nexport const t: <Content = string>(\n content?: CustomizableLanguageContent<Content>\n) => TranslationContent<Content> = tCore;\nexport const getTranslationContent: <Content = string>(\n languageContent: CustomizableLanguageContent<Content>,\n locale: Locales\n) => Content = getTranslationContentCore;\n\nexport type {\n LanguageContent,\n QuantityContent,\n ContentValue,\n DeclarationContent,\n} from '@intlayer/core';\nexport {\n getLocaleName,\n enu,\n getEnumerationContent,\n getHTMLLang,\n getHTMLTextDir,\n localeList,\n} from '@intlayer/core';\nexport type {\n LocalesValues,\n CustomIntlayerConfig as IntlayerConfig,\n} from '@intlayer/config/client';\nexport { Locales } from '@intlayer/config/client';\n"],"mappings":"AACA;AAAA,EAEE,KAAK;AAAA,EACL,yBAAyB;AAAA,OAEpB;AAgBA,MAAM,IAEsB;AAC5B,MAAM,wBAGE;AAQf;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,eAAe;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Locales } from '@intlayer/config/client';
|
|
2
|
+
import { type TranslationContent, type LanguageContent } from '@intlayer/core';
|
|
3
|
+
export interface IConfigLocales<Content> {
|
|
4
|
+
}
|
|
5
|
+
type ConfigLocales = keyof IConfigLocales<unknown>;
|
|
6
|
+
export type CustomizableLanguageContent<Content = string> = ConfigLocales extends never ? LanguageContent<Content> : IConfigLocales<Content>;
|
|
7
|
+
export declare const t: <Content = string>(content?: CustomizableLanguageContent<Content>) => TranslationContent<Content>;
|
|
8
|
+
export declare const getTranslationContent: <Content = string>(languageContent: CustomizableLanguageContent<Content>, locale: Locales) => Content;
|
|
9
|
+
export type { LanguageContent, QuantityContent, ContentValue, DeclarationContent, } from '@intlayer/core';
|
|
10
|
+
export { getLocaleName, enu, getEnumerationContent, getHTMLLang, getHTMLTextDir, localeList, } from '@intlayer/core';
|
|
11
|
+
export type { LocalesValues, CustomIntlayerConfig as IntlayerConfig, } from '@intlayer/config/client';
|
|
12
|
+
export { Locales } from '@intlayer/config/client';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,KAAK,kBAAkB,EAGvB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,cAAc,CAAC,OAAO;CAEtC;AAED,KAAK,aAAa,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;AAEnD,MAAM,MAAM,2BAA2B,CAAC,OAAO,GAAG,MAAM,IACtD,aAAa,SAAS,KAAK,GACvB,eAAe,CAAC,OAAO,CAAC,GACxB,cAAc,CAAC,OAAO,CAAC,CAAC;AAG9B,eAAO,MAAM,CAAC,EAAE,CAAC,OAAO,GAAG,MAAM,EAC/B,OAAO,CAAC,EAAE,2BAA2B,CAAC,OAAO,CAAC,KAC3C,kBAAkB,CAAC,OAAO,CAAS,CAAC;AACzC,eAAO,MAAM,qBAAqB,EAAE,CAAC,OAAO,GAAG,MAAM,EACnD,eAAe,EAAE,2BAA2B,CAAC,OAAO,CAAC,EACrD,MAAM,EAAE,OAAO,KACZ,OAAmC,CAAC;AAEzC,YAAY,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,GAAG,EACH,qBAAqB,EACrB,WAAW,EACX,cAAc,EACd,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,aAAa,EACb,oBAAoB,IAAI,cAAc,GACvC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Manage internationalization in a simple way, through TypeScript, declaration file, declare your multilingual every where in your code.",
|
|
6
6
|
"keywords": [
|
|
@@ -14,27 +14,27 @@
|
|
|
14
14
|
],
|
|
15
15
|
"homepage": "https://intlayer.org",
|
|
16
16
|
"bugs": {
|
|
17
|
-
"url": "https://github.com/
|
|
17
|
+
"url": "https://github.com/aymericzip/intlayer/issues"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/
|
|
21
|
+
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"author": {
|
|
25
25
|
"name": "Aymeric PINEAU",
|
|
26
|
-
"url": "https://github.com/
|
|
26
|
+
"url": "https://github.com/aymericzip"
|
|
27
27
|
},
|
|
28
28
|
"contributors": [
|
|
29
29
|
{
|
|
30
30
|
"name": "Aymeric Pineau",
|
|
31
31
|
"email": "ay.pineau@gmail.com",
|
|
32
|
-
"url": "https://github.com/
|
|
32
|
+
"url": "https://github.com/aymericzip"
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
-
"types": "./dist/
|
|
37
|
+
"types": "./dist/types/index.d.ts",
|
|
38
38
|
"require": "./dist/cjs/index.cjs",
|
|
39
39
|
"import": "./dist/esm/index.mjs"
|
|
40
40
|
},
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"main": "dist/cjs/index.cjs",
|
|
44
44
|
"module": "dist/esm/index.mjs",
|
|
45
|
+
"types": "dist/types/index.d.ts",
|
|
45
46
|
"typesVersions": {
|
|
46
47
|
"*": {
|
|
47
48
|
"package.json": [
|
|
@@ -55,37 +56,45 @@
|
|
|
55
56
|
],
|
|
56
57
|
"dependencies": {
|
|
57
58
|
"webpack": "^5.92.1",
|
|
58
|
-
"@intlayer/config": "^
|
|
59
|
-
"@intlayer/core": "^
|
|
60
|
-
"intlayer": "^
|
|
59
|
+
"@intlayer/config": "^3.0.1",
|
|
60
|
+
"@intlayer/core": "^3.0.1",
|
|
61
|
+
"intlayer": "^3.0.1"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@changesets/changelog-github": "0.5.0",
|
|
64
65
|
"@changesets/cli": "2.27.1",
|
|
65
66
|
"@types/node": "^20.14.9",
|
|
67
|
+
"concurrently": "^8.2.2",
|
|
68
|
+
"eslint": "^9.11.1",
|
|
69
|
+
"prettier": "3.3.3",
|
|
66
70
|
"rimraf": "5.0.5",
|
|
67
|
-
"
|
|
71
|
+
"tsc-alias": "^1.8.10",
|
|
72
|
+
"tsup": "^8.3.0",
|
|
68
73
|
"typescript": "^5.5.2",
|
|
69
74
|
"@utils/eslint-config": "^1.0.4",
|
|
70
|
-
"@utils/ts-config": "^1.0.4"
|
|
75
|
+
"@utils/ts-config-types": "^1.0.4",
|
|
76
|
+
"@utils/ts-config": "^1.0.4",
|
|
77
|
+
"@utils/tsup-config": "^1.0.4"
|
|
71
78
|
},
|
|
72
79
|
"engines": {
|
|
73
80
|
"node": ">=14.18"
|
|
74
81
|
},
|
|
75
82
|
"bug": {
|
|
76
|
-
"url": "https://github.com/
|
|
83
|
+
"url": "https://github.com/aymericzip/intlayer/issues"
|
|
77
84
|
},
|
|
78
85
|
"scripts": {
|
|
79
|
-
"build": "
|
|
86
|
+
"build": "pnpm build:package & pnpm build:types",
|
|
87
|
+
"build:package": "tsup",
|
|
88
|
+
"build:types": "tsc --project ./tsconfig.types.json && tsc-alias --project ./tsconfig.types.json",
|
|
80
89
|
"clean": "rimraf ./dist",
|
|
81
|
-
"dev": "tsup --watch",
|
|
82
|
-
"lint": "eslint . --
|
|
83
|
-
"lint:fix": "eslint . --
|
|
84
|
-
"prettier": "prettier --check
|
|
85
|
-
"prettier:fix": "prettier --write
|
|
90
|
+
"dev": "concurrently --prefix none \"tsup --watch\" \"tsc --project ./tsconfig.types.json --watch\" \"tsc-alias --project ./tsconfig.types.json --watch\"",
|
|
91
|
+
"lint": "eslint . --cache",
|
|
92
|
+
"lint:fix": "eslint . --cache --fix",
|
|
93
|
+
"prettier": "prettier . --check",
|
|
94
|
+
"prettier:fix": "prettier . --write",
|
|
86
95
|
"serve": "webpack serve --config ./webpack.config.ts",
|
|
87
96
|
"transpile": "webpack --config ./webpack.config.ts",
|
|
88
|
-
"typecheck": "tsup--project ./tsconfig.json --noEmit",
|
|
97
|
+
"typecheck": "tsup --project ./tsconfig.json --noEmit",
|
|
89
98
|
"watch": "webpack --config ./webpack.config.ts --watch"
|
|
90
99
|
}
|
|
91
100
|
}
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Locales } from '@intlayer/config/client';
|
|
2
|
-
export { CustomIntlayerConfig as IntlayerConfig, Locales, LocalesValues } from '@intlayer/config/client';
|
|
3
|
-
import { LanguageContent, TranslationContent } from '@intlayer/core';
|
|
4
|
-
export { ContentValue, DeclarationContent, LanguageContent, QuantityContent, enu, getEnumerationContent, getLocaleName } from '@intlayer/core';
|
|
5
|
-
|
|
6
|
-
interface IConfigLocales<Content> {
|
|
7
|
-
}
|
|
8
|
-
type ConfigLocales = keyof IConfigLocales<unknown>;
|
|
9
|
-
type CustomizableLanguageContent<Content = string> = ConfigLocales extends never ? LanguageContent<Content> : IConfigLocales<Content>;
|
|
10
|
-
declare const t: <Content = string>(content?: CustomizableLanguageContent<Content>) => TranslationContent<Content>;
|
|
11
|
-
declare const getTranslationContent: <Content = string>(languageContent: CustomizableLanguageContent<Content>, locale: Locales) => Content;
|
|
12
|
-
|
|
13
|
-
export { type CustomizableLanguageContent, type IConfigLocales, getTranslationContent, t };
|
package/dist/esm/index.d.mts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Locales } from '@intlayer/config/client';
|
|
2
|
-
export { CustomIntlayerConfig as IntlayerConfig, Locales, LocalesValues } from '@intlayer/config/client';
|
|
3
|
-
import { LanguageContent, TranslationContent } from '@intlayer/core';
|
|
4
|
-
export { ContentValue, DeclarationContent, LanguageContent, QuantityContent, enu, getEnumerationContent, getLocaleName } from '@intlayer/core';
|
|
5
|
-
|
|
6
|
-
interface IConfigLocales<Content> {
|
|
7
|
-
}
|
|
8
|
-
type ConfigLocales = keyof IConfigLocales<unknown>;
|
|
9
|
-
type CustomizableLanguageContent<Content = string> = ConfigLocales extends never ? LanguageContent<Content> : IConfigLocales<Content>;
|
|
10
|
-
declare const t: <Content = string>(content?: CustomizableLanguageContent<Content>) => TranslationContent<Content>;
|
|
11
|
-
declare const getTranslationContent: <Content = string>(languageContent: CustomizableLanguageContent<Content>, locale: Locales) => Content;
|
|
12
|
-
|
|
13
|
-
export { type CustomizableLanguageContent, type IConfigLocales, getTranslationContent, t };
|