Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vocab/cli

Package Overview
Dependencies
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vocab/cli - npm Package Compare versions

Comparing version 1.3.7 to 1.4.0

7

dist/vocab-cli.cjs.dev.js

@@ -49,3 +49,8 @@ 'use strict';

builder: () => yargs__default["default"].options({
branch: branchDefinition
branch: branchDefinition,
'error-on-no-global-key-translation': {
type: 'boolean',
describe: 'Throw an error when there is no translation for a global key',
default: false
}
}),

@@ -52,0 +57,0 @@ handler: async options => {

@@ -49,3 +49,8 @@ 'use strict';

builder: () => yargs__default["default"].options({
branch: branchDefinition
branch: branchDefinition,
'error-on-no-global-key-translation': {
type: 'boolean',
describe: 'Throw an error when there is no translation for a global key',
default: false
}
}),

@@ -52,0 +57,0 @@ handler: async options => {

@@ -42,3 +42,8 @@ import { push, pull } from '@vocab/phrase';

builder: () => yargs.options({
branch: branchDefinition
branch: branchDefinition,
'error-on-no-global-key-translation': {
type: 'boolean',
describe: 'Throw an error when there is no translation for a global key',
default: false
}
}),

@@ -45,0 +50,0 @@ handler: async options => {

6

package.json
{
"name": "@vocab/cli",
"version": "1.3.7",
"version": "1.4.0",
"main": "dist/vocab-cli.cjs.js",

@@ -17,4 +17,4 @@ "module": "dist/vocab-cli.esm.js",

"@types/env-ci": "^3.1.0",
"@vocab/core": "^1.4.0",
"@vocab/phrase": "^1.2.8",
"@vocab/core": "^1.5.0",
"@vocab/phrase": "^1.3.0",
"env-ci": "^5.0.2",

@@ -21,0 +21,0 @@ "fast-glob": "^3.2.4",

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc