@plop-next/i18n 0.1.2 → 0.1.4
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 +18 -28
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,36 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
Internationalization plugin for plop-next.
|
|
4
4
|
|
|
5
|
-
This package
|
|
5
|
+
This package is designed to be used with `@plop-next/cli`.
|
|
6
|
+
|
|
7
|
+
For normal usage, treat it as a CLI extension layer (not a standalone package).
|
|
6
8
|
|
|
7
9
|
## Installation
|
|
8
10
|
|
|
9
11
|
```bash
|
|
10
|
-
npm install @plop-next/
|
|
12
|
+
npm install -D @plop-next/cli @plop-next/i18n
|
|
11
13
|
```
|
|
12
14
|
|
|
13
15
|
or:
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
yarn add @plop-next/
|
|
18
|
+
yarn add -D @plop-next/cli @plop-next/i18n
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
##
|
|
21
|
+
## Usage with CLI
|
|
20
22
|
|
|
21
23
|
```ts
|
|
22
|
-
import {
|
|
24
|
+
import type { PlopNext } from "@plop-next/cli";
|
|
23
25
|
import { PlopNextI18n } from "@plop-next/i18n";
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
const i18n = new PlopNextI18n(
|
|
27
|
+
export default function plop(plop: PlopNext) {
|
|
28
|
+
const i18n = new PlopNextI18n(plop);
|
|
27
29
|
|
|
28
|
-
i18n.registerLocale("fr", {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
30
|
+
i18n.registerLocale("fr", {
|
|
31
|
+
cli: {
|
|
32
|
+
selectGenerator: "Choisissez un generateur",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
plop.useI18n({ force: "fr" });
|
|
37
|
+
}
|
|
35
38
|
```
|
|
36
39
|
|
|
37
40
|
## Built-in locales
|
|
@@ -42,21 +45,8 @@ core.useI18n({ force: "fr" });
|
|
|
42
45
|
- `pt`
|
|
43
46
|
- `zh`
|
|
44
47
|
|
|
45
|
-
## Common exports
|
|
46
|
-
|
|
47
|
-
- `PlopNextI18n`
|
|
48
|
-
- `I18nRegistry`
|
|
49
|
-
- `EN_MESSAGES`, `FR_MESSAGES`, `ES_MESSAGES`, `PT_MESSAGES`, `ZH_MESSAGES`
|
|
50
|
-
|
|
51
|
-
## Development scripts
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
yarn workspace @plop-next/i18n build
|
|
55
|
-
yarn workspace @plop-next/i18n test
|
|
56
|
-
```
|
|
57
|
-
|
|
58
48
|
## Links
|
|
59
49
|
|
|
60
50
|
- Documentation: [https://nivvdiy.github.io/plop-next/](https://nivvdiy.github.io/plop-next/)
|
|
61
|
-
- Repository: [https://github.com/
|
|
62
|
-
- Issues: [https://github.com/
|
|
51
|
+
- Repository: [https://github.com/Nivvdiy/plop-next](https://github.com/Nivvdiy/plop-next)
|
|
52
|
+
- Issues: [https://github.com/Nivvdiy/plop-next/issues](https://github.com/Nivvdiy/plop-next/issues)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plop-next/i18n",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Internationalization utilities for plop-next",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/Nivvdiy/plop-next/issues"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@inquirer/i18n": "^1.0.2",
|
|
26
|
-
"@plop-next/core": "
|
|
26
|
+
"@plop-next/core": "^0.1.3",
|
|
27
27
|
"dlv": "^1.1.3",
|
|
28
28
|
"resolve": "^1.22.11",
|
|
29
29
|
"tinyglobby": "^0.2.15"
|