@vocab/react 1.1.5 → 1.1.7
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 +13 -4
- package/dist/declarations/src/index.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,10 +20,11 @@ Vocab helps you ship multiple languages without compromising the reliability of
|
|
|
20
20
|
|
|
21
21
|
### Step 1: Install Dependencies
|
|
22
22
|
|
|
23
|
-
Vocab is a monorepo with different packages you can install depending on your usage, the below list will get you started using the
|
|
23
|
+
Vocab is a monorepo with different packages you can install depending on your usage, the below list will get you started using the CLI and React integration.
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
$ npm i --save @vocab/cli
|
|
26
|
+
$ npm i --save-dev @vocab/cli
|
|
27
|
+
$ npm i --save @vocab/core @vocab/react
|
|
27
28
|
```
|
|
28
29
|
|
|
29
30
|
### Step 2: Configure Vocab
|
|
@@ -116,6 +117,10 @@ Right now every language is loaded into your web application all the time, which
|
|
|
116
117
|
|
|
117
118
|
This is done using the **VocabWebpackPlugin**. Applying this plugin to your client webpack configuration will replace all vocab files with a dynamic asynchronous chunks designed for the web.
|
|
118
119
|
|
|
120
|
+
```bash
|
|
121
|
+
$ npm i --save-dev @vocab/webpack
|
|
122
|
+
```
|
|
123
|
+
|
|
119
124
|
**webpack.config.js**
|
|
120
125
|
|
|
121
126
|
```js
|
|
@@ -206,7 +211,7 @@ module.exports = {
|
|
|
206
211
|
*/
|
|
207
212
|
generatedLanguages: [
|
|
208
213
|
{
|
|
209
|
-
name: '
|
|
214
|
+
name: 'generatedLanguage',
|
|
210
215
|
extends: 'en',
|
|
211
216
|
generator: {
|
|
212
217
|
transformElement: capitalize,
|
|
@@ -296,6 +301,10 @@ const App = () => (
|
|
|
296
301
|
|
|
297
302
|
The `@vocab/pseudo-localize` package exports low-level functions that can be used for pseudo-localization of translation messages.
|
|
298
303
|
|
|
304
|
+
```bash
|
|
305
|
+
$ npm i --save-dev @vocab/pseudo-localize
|
|
306
|
+
```
|
|
307
|
+
|
|
299
308
|
```ts
|
|
300
309
|
import {
|
|
301
310
|
extendVowels,
|
|
@@ -441,7 +450,7 @@ $ vocab pull --branch my-branch
|
|
|
441
450
|
|
|
442
451
|
When uploading translations, Phrase identifies keys that exist in the Phrase project, but were not
|
|
443
452
|
referenced in the upload. These keys can be deleted from Phrase by providing the
|
|
444
|
-
|
|
453
|
+
`--delete-unused-keys` flag to `vocab push`. E.g.
|
|
445
454
|
|
|
446
455
|
```sh
|
|
447
456
|
$ vocab push --branch my-branch --delete-unused-keys
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vocab/react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"main": "dist/vocab-react.cjs.js",
|
|
5
5
|
"module": "dist/vocab-react.esm.js",
|
|
6
6
|
"author": "SEEK",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@vocab/core": "^1.
|
|
15
|
+
"@vocab/core": "^1.4.0",
|
|
16
16
|
"intl-messageformat": "^10.0.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|