next-intlayer 4.1.0 → 4.1.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 +9 -10
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<a href="https://
|
|
2
|
+
<a href="https://intlayer.org">
|
|
3
3
|
<img src="https://raw.githubusercontent.com/aymericzip/intlayer/572ae9c9acafb74307b81530c1931a8e98990aef/docs/assets/logo.png" width="500" alt="intlayer" />
|
|
4
4
|
</a>
|
|
5
5
|
</div>
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
<a href="https://npmjs.org/package/next-intlayer">
|
|
15
15
|
<img alt="types included" src="https://badgen.net/npm/types/next-intlayer?labelColor=49516F&color=8994BC"
|
|
16
16
|
/>
|
|
17
|
-
</a>
|
|
18
17
|
</div>
|
|
19
18
|
|
|
20
19
|
# next-intlayer: Internationalize (i18n) an Next.js application
|
|
@@ -55,7 +54,7 @@ With Intlayer, you can declare your content in a structured way anywhere in your
|
|
|
55
54
|
|
|
56
55
|
By default, Intlayer scans for files with the extension `.content.{ts,tsx,js,jsx,mjs,cjs}`.
|
|
57
56
|
|
|
58
|
-
> You can modify the default extension by setting the `contentDir` property in the [configuration file](https://
|
|
57
|
+
> You can modify the default extension by setting the `contentDir` property in the [configuration file](https://intlayer.org//doc/concept/configuration).
|
|
59
58
|
|
|
60
59
|
```bash codeFormat="typescript"
|
|
61
60
|
.
|
|
@@ -159,22 +158,22 @@ const ClientComponentExample = () => {
|
|
|
159
158
|
Intlayer provides a lot of features to help you internationalize your Next.js application. Here are some of the key features:
|
|
160
159
|
|
|
161
160
|
- **Internationalization of server components**: Intlayer allows you to internationalize your server components in the same way as your client components. This means that you can use the same content declarations for both client and server components.
|
|
162
|
-
- **Middleware for Locale Detection**: Intlayer provides middleware to detect the user's preferred locale. This middleware is used to detect the user's preferred locale and redirect them to the appropriate URL as specified in the [configuration](https://
|
|
161
|
+
- **Middleware for Locale Detection**: Intlayer provides middleware to detect the user's preferred locale. This middleware is used to detect the user's preferred locale and redirect them to the appropriate URL as specified in the [configuration](https://intlayer.org//doc/concept/configuration).
|
|
163
162
|
- **Internationalization of metadata**: Intlayer provides a way to internationalize your metadata, such as the title of your page, using the `generateMetadata` function provided by Next.js. You can use the `getTranslationContent` function to translate your metadata.
|
|
164
163
|
- **Internationalization of sitemap.xml and robots.txt**: Intlayer allows you to internationalize your sitemap.xml and robots.txt files. You can use the `getMultilingualUrls` function to generate multilingual URLs for your sitemap.
|
|
165
164
|
- **Internationalization of URLs**: Intlayer allows you to internationalize your URLs by using the `getMultilingualUrls` function. This function generates multilingual URLs for your sitemap.
|
|
166
165
|
|
|
167
|
-
**To learn more about these features, refer to the [Next.js Internationalization (i18n) with Intlayer and Next.js 15 App Router](https://
|
|
166
|
+
**To learn more about these features, refer to the [Next.js Internationalization (i18n) with Intlayer and Next.js 15 App Router](https://intlayer.org//doc/environment/nextjs) guide.**
|
|
168
167
|
|
|
169
168
|
## Functions provided by `next-intlayer` package
|
|
170
169
|
|
|
171
170
|
The `next-intlayer` package also provides some functions to help you to internationalize your application.
|
|
172
171
|
|
|
173
|
-
- [`t()`](https://
|
|
174
|
-
- [`useIntlayer()`](https://
|
|
175
|
-
- [`useDictionary()`](https://
|
|
176
|
-
- [`useLocale()`](https://
|
|
177
|
-
- [`useIntlayerAsync()`](https://
|
|
172
|
+
- [`t()`](https://intlayer.org//doc/packages/next-intlayer/t)
|
|
173
|
+
- [`useIntlayer()`](https://intlayer.org//doc/packages/next-intlayer/useIntlayer)
|
|
174
|
+
- [`useDictionary()`](https://intlayer.org//doc/packages/next-intlayer/useDictionary)
|
|
175
|
+
- [`useLocale()`](https://intlayer.org//doc/packages/next-intlayer/useLocale)
|
|
176
|
+
- [`useIntlayerAsync()`](https://intlayer.org//doc/packages/next-intlayer/useIntlayerAsync)
|
|
178
177
|
|
|
179
178
|
## Read about Intlayer
|
|
180
179
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intlayer",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Simplify internationalization i18n in Next.js with context providers, hooks, locale detection, and multilingual content integration.",
|
|
6
6
|
"keywords": [
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
],
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"node-loader": "^2.1.0",
|
|
75
|
-
"@intlayer/
|
|
76
|
-
"@intlayer/
|
|
77
|
-
"
|
|
78
|
-
"@intlayer/
|
|
79
|
-
"
|
|
80
|
-
"@intlayer/
|
|
75
|
+
"@intlayer/chokidar": "4.1.1",
|
|
76
|
+
"@intlayer/webpack": "4.1.1",
|
|
77
|
+
"react-intlayer": "4.1.1",
|
|
78
|
+
"@intlayer/core": "4.1.1",
|
|
79
|
+
"@intlayer/dictionaries-entry": "4.1.1",
|
|
80
|
+
"@intlayer/config": "4.1.1"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@types/node": "^22.10.6",
|
|
@@ -90,21 +90,21 @@
|
|
|
90
90
|
"tsc-alias": "^1.8.10",
|
|
91
91
|
"tsup": "^8.3.5",
|
|
92
92
|
"typescript": "^5.7.3",
|
|
93
|
+
"@utils/eslint-config": "1.0.4",
|
|
93
94
|
"@utils/ts-config": "1.0.4",
|
|
94
|
-
"@utils/tsup-config": "1.0.4",
|
|
95
|
-
"intlayer": "4.1.0",
|
|
96
95
|
"@utils/ts-config-types": "1.0.4",
|
|
97
|
-
"@utils/
|
|
96
|
+
"@utils/tsup-config": "1.0.4",
|
|
97
|
+
"intlayer": "4.1.1"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"next": ">=14.0.0",
|
|
101
101
|
"react": ">=16.0.0",
|
|
102
|
-
"@intlayer/
|
|
103
|
-
"@intlayer/core": "4.1.
|
|
104
|
-
"@intlayer/
|
|
105
|
-
"intlayer": "4.1.
|
|
106
|
-
"
|
|
107
|
-
"
|
|
102
|
+
"@intlayer/config": "4.1.1",
|
|
103
|
+
"@intlayer/core": "4.1.1",
|
|
104
|
+
"@intlayer/dictionaries-entry": "4.1.1",
|
|
105
|
+
"@intlayer/webpack": "4.1.1",
|
|
106
|
+
"intlayer": "4.1.1",
|
|
107
|
+
"react-intlayer": "^4.1.1"
|
|
108
108
|
},
|
|
109
109
|
"engines": {
|
|
110
110
|
"node": ">=14.18"
|