@vocab/cli
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "@vocab/cli", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"main": "dist/vocab-cli.cjs.js", | ||
@@ -9,2 +9,6 @@ "module": "dist/vocab-cli.esm.js", | ||
}, | ||
"files": [ | ||
"dist", | ||
"bin.js" | ||
], | ||
"author": "SEEK", | ||
@@ -14,4 +18,4 @@ "license": "MIT", | ||
"@types/env-ci": "^3.1.0", | ||
"@vocab/core": "^1.1.0", | ||
"@vocab/phrase": "^1.1.0", | ||
"@vocab/core": "^1.2.0", | ||
"@vocab/phrase": "^1.2.0", | ||
"env-ci": "^5.0.2", | ||
@@ -18,0 +22,0 @@ "fast-glob": "^3.2.4", |
@@ -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
22913
9
220
Updated@vocab/core@^1.2.0
Updated@vocab/phrase@^1.2.0