@vocab/react
Advanced tools
Comparing version 1.1.3 to 1.1.4
{ | ||
"name": "@vocab/react", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"main": "dist/vocab-react.cjs.js", | ||
@@ -11,4 +11,7 @@ "module": "dist/vocab-react.esm.js", | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"dependencies": { | ||
"@vocab/types": "^1.1.1", | ||
"@vocab/types": "^1.1.2", | ||
"intl-messageformat": "^10.0.0" | ||
@@ -15,0 +18,0 @@ }, |
@@ -425,16 +425,77 @@ # Vocab | ||
## External translation tooling | ||
## External Translation Tooling | ||
Vocab can be used to synchronize your translations with translations from a remote translation platform. | ||
| Platform | Environment Variables | | ||
| -------------------------------------------- | ----------------------------------- | | ||
| [Phrase](https://developers.phrase.com/api/) | PHRASE_PROJECT_ID, PHRASE_API_TOKEN | | ||
| Platform | Environment Variables | | ||
| -------- | ----------------------------------- | | ||
| [Phrase] | PHRASE_PROJECT_ID, PHRASE_API_TOKEN | | ||
```bash | ||
$ vocab push --branch my-branch | ||
$ vocab push --branch my-branch --delete-unused-keys | ||
$ vocab pull --branch my-branch | ||
``` | ||
### [Phrase] Platform Features | ||
#### Delete Unused keys | ||
When uploading translations, Phrase identifies keys that exist in the Phrase project, but were not | ||
referenced in the upload. These keys can be deleted from Phrase by providing the | ||
`---delete-unused-keys` flag to `vocab push`. E.g. | ||
```sh | ||
$ vocab push --branch my-branch --delete-unused-keys | ||
``` | ||
[phrase]: https://developers.phrase.com/api/ | ||
#### [Tags] | ||
`vocab push` supports uploading [tags] to Phrase. | ||
Tags can be added to an individual key via the `tags` property: | ||
```jsonc | ||
// translations.json | ||
{ | ||
"Hello": { | ||
"message": "Hello", | ||
"tags": ["greeting", "home_page"] | ||
}, | ||
"Goodbye": { | ||
"message": "Goodbye", | ||
"tags": ["home_page"] | ||
} | ||
} | ||
``` | ||
Tags can also be added under a top-level `_meta` field. This will result in the tags applying to all | ||
keys specified in the file: | ||
```jsonc | ||
// translations.json | ||
{ | ||
"_meta": { | ||
"tags": ["home_page"] | ||
}, | ||
"Hello": { | ||
"message": "Hello", | ||
"tags": ["greeting"] | ||
}, | ||
"Goodbye": { | ||
"message": "Goodbye" | ||
} | ||
} | ||
``` | ||
In the above example, both the `Hello` and `Goodbye` keys would have the `home_page` tag attached to | ||
them, but only the `Hello` key would have the `usage_greeting` tag attached to it. | ||
**NOTE**: Only tags specified on keys in your [`devLanguage`][configuration] will be uploaded. | ||
Tags on keys in other languages will be ignored. | ||
[tags]: https://support.phrase.com/hc/en-us/articles/5822598372252-Tags-Strings- | ||
[configuration]: #Configuration | ||
## Troubleshooting | ||
@@ -441,0 +502,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
510
26541
8
260
Updated@vocab/types@^1.1.2