-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a76e4af
commit 1a639f5
Showing
13 changed files
with
269 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
'@vocab/phrase': minor | ||
'@vocab/core': minor | ||
--- | ||
|
||
`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. | ||
|
||
**EXAMPLE USAGE**: | ||
|
||
```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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
'@vocab/cli': minor | ||
--- | ||
|
||
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: | ||
|
||
**EXAMPLE USAGE**: | ||
|
||
```sh | ||
vocab pull --error-on-no-global-key-translation | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
'@vocab/phrase': minor | ||
--- | ||
|
||
Add an optional `errorOnNoGlobalKeyTranslation` flag to `pull` function. If set to `true`, it will error if a translation is missing in Phrase for a translation with a global key. | ||
|
||
**EXAMPLE USAGE**: | ||
|
||
```js | ||
import { pull } from '@vocab/phrase'; | ||
|
||
const vocabConfig = { | ||
devLanguage: 'en', | ||
language: ['en', 'fr'], | ||
}; | ||
|
||
await pull({ branch: 'myBranch', errorOnNoGlobalKeyTranslation: true }, vocabConfig); | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,8 @@ | |
}, | ||
"world": { | ||
"message": "monde" | ||
}, | ||
"profile": { | ||
"message": "profil" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.