@vocab/react
Advanced tools
Comparing version 1.1.7 to 1.1.8
{ | ||
"name": "@vocab/react", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"main": "dist/vocab-react.cjs.js", | ||
@@ -15,3 +15,3 @@ "module": "dist/vocab-react.esm.js", | ||
"dependencies": { | ||
"@vocab/core": "^1.4.0", | ||
"@vocab/core": "^1.5.0", | ||
"intl-messageformat": "^10.0.0" | ||
@@ -18,0 +18,0 @@ }, |
@@ -509,2 +509,34 @@ # Vocab | ||
#### Global key | ||
`vocab push` and `vocab pull` can support global keys mapping. When you want certain translations to use a specific/custom key in Phrase, add the `globalKey` to the structure. | ||
```jsonc | ||
// translations.json | ||
{ | ||
"Hello": { | ||
"message": "Hello", | ||
"globalKey": "hello" | ||
}, | ||
"Goodbye": { | ||
"message": "Goodbye", | ||
"globalKey": "app.goodbye.label" | ||
} | ||
} | ||
``` | ||
In the above example, | ||
- `vocab push` will push the `hello` and `app.goodbye.label` keys to Phrase. | ||
- `vocab pull` will pull translations from Phrase and map them to the `hello` and `app.goodbye.label` keys. | ||
##### Error on no translation for global key | ||
By default, `vocab pull` will not error if a translation is missing in Phrase for a translation with a global key. | ||
If you want to throw an error in this situation, pass the `--error-on-no-global-key-translation` flag: | ||
```sh | ||
vocab pull --error-on-no-global-key-translation | ||
``` | ||
## Troubleshooting | ||
@@ -511,0 +543,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28542
551
Updated@vocab/core@^1.5.0