lynx-intlayer 5.3.1 → 5.3.2
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 -24
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -5,70 +5,69 @@
|
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<div align="center">
|
|
8
|
-
<a href="https://www.npmjs.com/package/
|
|
9
|
-
<img alt="npm" src="https://img.shields.io/npm/v/
|
|
8
|
+
<a href="https://www.npmjs.com/package/lynx-intlayer">
|
|
9
|
+
<img alt="npm" src="https://img.shields.io/npm/v/lynx-intlayer.svg?labelColor=49516F&color=8994BC" />
|
|
10
10
|
</a>
|
|
11
|
-
<a href="https://npmjs.org/package/
|
|
12
|
-
<img alt="downloads" src="https://badgen.net/npm/dm/
|
|
11
|
+
<a href="https://npmjs.org/package/lynx-intlayer">
|
|
12
|
+
<img alt="downloads" src="https://badgen.net/npm/dm/lynx-intlayer?labelColor=49516F&color=8994BC" />
|
|
13
13
|
</a>
|
|
14
|
-
<a href="https://npmjs.org/package/
|
|
15
|
-
<img alt="types included" src="https://badgen.net/npm/types/
|
|
14
|
+
<a href="https://npmjs.org/package/lynx-intlayer">
|
|
15
|
+
<img alt="types included" src="https://badgen.net/npm/types/lynx-intlayer?labelColor=49516F&color=8994BC"
|
|
16
16
|
/>
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
|
-
#
|
|
19
|
+
# lynx-intlayer: Internationalize (i18n) an Lynx application
|
|
20
20
|
|
|
21
21
|
**Intlayer** is a suite of packages designed specifically for JavaScript developers. It is compatible with frameworks like React, React, and Express.js.
|
|
22
22
|
|
|
23
|
-
**The `
|
|
23
|
+
**The `lynx-intlayer` package** allows you to internationalize your Vite application. It includes the Metro plugin to set the configuration through environment variables into the [Lynx bundler](https://lynxjs.org/index.html).
|
|
24
24
|
|
|
25
|
-
## Why Internationalize Your
|
|
25
|
+
## Why Internationalize Your Lynx Application?
|
|
26
26
|
|
|
27
|
-
Internationalizing your
|
|
27
|
+
Internationalizing your Lynx application is essential for serving a global audience effectively. It allows your application to deliver content and messages in the preferred language of each user. This capability enhances user experience and broadens your application's reach by making it more accessible and relevant to people from different linguistic backgrounds.
|
|
28
28
|
|
|
29
29
|
## Configuration
|
|
30
30
|
|
|
31
|
-
The `
|
|
31
|
+
The `lynx-intlayer` package works seamlessly with the [`react-intlayer` package](https://github.com/aymericzip/intlayer/blob/main/docs/en/packages/react-intlayer/index.md), and the [`intlayer` package](https://github.com/aymericzip/intlayer/blob/main/docs/en/packages/intlayer/index.md). Have a look at the relevant documentation for more information.
|
|
32
32
|
|
|
33
33
|
## Installation
|
|
34
34
|
|
|
35
35
|
Install the necessary package using your preferred package manager:
|
|
36
36
|
|
|
37
37
|
```bash packageManager="npm"
|
|
38
|
-
npm install
|
|
38
|
+
npm install lynx-intlayer
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
```bash packageManager="yarn"
|
|
42
|
-
yarn add
|
|
42
|
+
yarn add lynx-intlayer
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
```bash packageManager="pnpm"
|
|
46
|
-
pnpm add
|
|
46
|
+
pnpm add lynx-intlayer
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
## Example of usage
|
|
50
50
|
|
|
51
51
|
See an example of how to include the plugins into your vite configuration.
|
|
52
52
|
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
import {
|
|
53
|
+
```ts
|
|
54
|
+
// lynx.config.ts
|
|
55
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
56
|
+
import { pluginIntlayerLynx } from "lynx-intlayer/plugin";
|
|
56
57
|
|
|
57
|
-
// https://vitejs.dev/config/
|
|
58
58
|
export default defineConfig({
|
|
59
|
-
plugins: [
|
|
59
|
+
plugins: [
|
|
60
|
+
// ... other plugins
|
|
61
|
+
pluginIntlayerLynx(),
|
|
62
|
+
],
|
|
60
63
|
});
|
|
61
64
|
```
|
|
62
65
|
|
|
63
|
-
> The `intlayerPlugin()` Vite plugin is used to integrate Intlayer with Vite. It ensures the building of content declaration files and monitors them in development mode. It defines Intlayer environment variables within the Vite application. Additionally, it provides aliases to optimize performance.
|
|
64
|
-
|
|
65
|
-
> The `intLayerMiddlewarePlugin()` add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
|
|
66
|
-
|
|
67
66
|
## Mastering the internationalization of your Vite application
|
|
68
67
|
|
|
69
68
|
Intlayer provides a lot of features to help you internationalize your Vite application.
|
|
70
69
|
|
|
71
|
-
**To learn more about these features, refer to the [React Internationalization (i18n) with Intlayer and
|
|
70
|
+
**To learn more about these features, refer to the [React Internationalization (i18n) with Intlayer and Lynx](https://github.com/aymericzip/intlayer/blob/main/docs/en/intlayer_with_lynx+react.md) guide for Lynx Application.**
|
|
72
71
|
|
|
73
72
|
## Read about Intlayer
|
|
74
73
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lynx-intlayer",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A React Native plugin for seamless internationalization (i18n), providing locale detection, redirection, and environment-based configuration",
|
|
6
6
|
"keywords": [
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"./package.json"
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@intlayer/chokidar": "5.3.
|
|
67
|
-
"@intlayer/config": "5.3.
|
|
68
|
-
"@intlayer/core": "5.3.
|
|
66
|
+
"@intlayer/chokidar": "5.3.2",
|
|
67
|
+
"@intlayer/config": "5.3.2",
|
|
68
|
+
"@intlayer/core": "5.3.2"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rsbuild/core": "^1.2.16",
|
|
@@ -82,15 +82,15 @@
|
|
|
82
82
|
"typescript": "^5.7.3",
|
|
83
83
|
"@utils/eslint-config": "1.0.4",
|
|
84
84
|
"@utils/ts-config": "1.0.4",
|
|
85
|
-
"@utils/
|
|
86
|
-
"@utils/
|
|
85
|
+
"@utils/tsup-config": "1.0.4",
|
|
86
|
+
"@utils/ts-config-types": "1.0.4"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"@lynx-js/rspeedy": "^0.8.2",
|
|
90
90
|
"@rsbuild/core": "^1.2.16",
|
|
91
|
-
"@intlayer/chokidar": "5.3.
|
|
92
|
-
"@intlayer/config": "5.3.
|
|
93
|
-
"@intlayer/core": "5.3.
|
|
91
|
+
"@intlayer/chokidar": "5.3.2",
|
|
92
|
+
"@intlayer/config": "5.3.2",
|
|
93
|
+
"@intlayer/core": "5.3.2"
|
|
94
94
|
},
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": ">=14.18"
|