intlayer 2.0.11 → 2.0.13
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 +43 -1
- package/package.json +22 -10
package/README.md
CHANGED
|
@@ -19,7 +19,49 @@
|
|
|
19
19
|
|
|
20
20
|
# Intlayer: Next-Level Content Management in JavaScript
|
|
21
21
|
|
|
22
|
-
**Intlayer** is an
|
|
22
|
+
**Intlayer** is an internationalization library designed specifically for JavaScript developers. It allow the declaration of your content everywhere in your code. It converts declaration of multilingual content into structured dictionaries to integrate easily in your code. Using TypeScript, **Intlayer** make your development stronger and more efficient.
|
|
23
|
+
|
|
24
|
+
## Example of usage
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
.
|
|
28
|
+
├── ClientComponent
|
|
29
|
+
│ ├── index.content.ts
|
|
30
|
+
│ └── index.tsx
|
|
31
|
+
└── ServerComponent
|
|
32
|
+
├── index.content.ts
|
|
33
|
+
└── index.tsx
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
// ./ClientComponent/index.content.ts
|
|
38
|
+
|
|
39
|
+
import { DeclarationContent, t } from "intlayer";
|
|
40
|
+
|
|
41
|
+
const clientComponentContent: DeclarationContent = {
|
|
42
|
+
id: "client-component",
|
|
43
|
+
myTranslatedContent: t({
|
|
44
|
+
en: "Hello World",
|
|
45
|
+
fr: "Bonjour le monde",
|
|
46
|
+
es: "Hola Mundo",
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default clientComponentContent;
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
// ./ClientComponent/index.tsx
|
|
55
|
+
"use client";
|
|
56
|
+
|
|
57
|
+
import { useIntlayer } from "next-intlayer";
|
|
58
|
+
|
|
59
|
+
export const ClientComponent = () => {
|
|
60
|
+
const { myTranslatedContent } = useIntlayer("client-component");
|
|
61
|
+
|
|
62
|
+
return <span>{myTranslatedContent}</span>;
|
|
63
|
+
};
|
|
64
|
+
```
|
|
23
65
|
|
|
24
66
|
## Why Choose Intlayer?
|
|
25
67
|
|
package/package.json
CHANGED
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Manage internationalization in a simple way, through TypeScript, declaration file, declare your multilingual every where in your code.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"intlayer",
|
|
8
8
|
"application",
|
|
9
9
|
"transpile",
|
|
10
10
|
"typescript",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
11
|
+
"multilingual",
|
|
12
|
+
"i18n",
|
|
13
|
+
"internationalization"
|
|
14
14
|
],
|
|
15
|
-
"homepage": "https://
|
|
15
|
+
"homepage": "https://intlayer.org",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/aypineau/intlayer/issues"
|
|
18
|
+
},
|
|
16
19
|
"repository": {
|
|
17
20
|
"type": "git",
|
|
18
21
|
"url": "git+https://github.com/aypineau/intlayer.git"
|
|
19
22
|
},
|
|
20
|
-
"license": "
|
|
23
|
+
"license": "Apache-2.0",
|
|
21
24
|
"author": {
|
|
22
25
|
"name": "Aymeric PINEAU",
|
|
23
26
|
"url": "https://github.com/aypineau"
|
|
24
27
|
},
|
|
28
|
+
"contributors": [
|
|
29
|
+
{
|
|
30
|
+
"name": "Aymeric Pineau",
|
|
31
|
+
"email": "ay.pineau@gmail.com",
|
|
32
|
+
"url": "https://github.com/aypineau"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
25
35
|
"exports": {
|
|
26
36
|
".": {
|
|
27
37
|
"types": "./dist/esm/index.d.mts",
|
|
@@ -30,6 +40,8 @@
|
|
|
30
40
|
},
|
|
31
41
|
"./package.json": "./package.json"
|
|
32
42
|
},
|
|
43
|
+
"main": "dist/cjs/index.cjs",
|
|
44
|
+
"module": "dist/esm/index.mjs",
|
|
33
45
|
"typesVersions": {
|
|
34
46
|
"*": {
|
|
35
47
|
"package.json": [
|
|
@@ -43,9 +55,9 @@
|
|
|
43
55
|
],
|
|
44
56
|
"dependencies": {
|
|
45
57
|
"webpack": "^5.92.1",
|
|
46
|
-
"@intlayer/config": "^2.0.
|
|
47
|
-
"@intlayer/core": "^2.0.
|
|
48
|
-
"intlayer": "^2.0.
|
|
58
|
+
"@intlayer/config": "^2.0.13",
|
|
59
|
+
"@intlayer/core": "^2.0.13",
|
|
60
|
+
"intlayer": "^2.0.13"
|
|
49
61
|
},
|
|
50
62
|
"devDependencies": {
|
|
51
63
|
"@changesets/changelog-github": "0.5.0",
|