Releases: seek-oss/vocab
@vocab/[email protected]
@vocab/[email protected]
Patch Changes
- Updated dependencies [
8228608
]:- @vocab/[email protected]
- @vocab/[email protected]
@vocab/[email protected]
Patch Changes
- Updated dependencies [
161d698
]:- @vocab/[email protected]
@vocab/[email protected]
Patch Changes
- Updated dependencies [
161d698
]:- @vocab/[email protected]
@vocab/[email protected]
Patch Changes
- Updated dependencies [
161d698
]:- @vocab/[email protected]
@vocab/[email protected]
Minor Changes
-
161d698
#170 Thanks @jasoncheng-jora! -vocab push
andvocab pull
can support global keys mapping. When you want certain translations to use a specific/custom key in Phrase, add theglobalKey
to the structure.EXAMPLE USAGE:
// translations.json { "Hello": { "message": "Hello", "globalKey": "hello" }, "Goodbye": { "message": "Goodbye", "globalKey": "app.goodbye.label" } }
In the above example,
vocab push
will push thehello
andapp.goodbye.label
keys to Phrase.vocab pull
will pull translations from Phrase and map them to thehello
andapp.goodbye.label
keys.
-
161d698
#170 Thanks @jasoncheng-jora! - Add an optionalerrorOnNoGlobalKeyTranslation
flag topull
function. If set totrue
, it will error if a translation is missing in Phrase for a translation with a global key.EXAMPLE USAGE:
import { pull } from '@vocab/phrase'; const vocabConfig = { devLanguage: 'en', language: ['en', 'fr'], }; await pull( { branch: 'myBranch', errorOnNoGlobalKeyTranslation: true }, vocabConfig, );
Patch Changes
- Updated dependencies [
161d698
]:- @vocab/[email protected]
@vocab/[email protected]
Minor Changes
-
161d698
#170 Thanks @jasoncheng-jora! -vocab push
andvocab pull
can support global keys mapping. When you want certain translations to use a specific/custom key in Phrase, add theglobalKey
to the structure.EXAMPLE USAGE:
// translations.json { "Hello": { "message": "Hello", "globalKey": "hello" }, "Goodbye": { "message": "Goodbye", "globalKey": "app.goodbye.label" } }
In the above example,
vocab push
will push thehello
andapp.goodbye.label
keys to Phrase.vocab pull
will pull translations from Phrase and map them to thehello
andapp.goodbye.label
keys.
@vocab/[email protected]
Minor Changes
-
161d698
#170 Thanks @jasoncheng-jora! - Error on no translation for global keyBy 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:
vocab pull --error-on-no-global-key-translation
Patch Changes
- Updated dependencies [
161d698
,161d698
]:- @vocab/[email protected]
- @vocab/[email protected]
@vocab/[email protected]
Patch Changes
- Updated dependencies [
09b7179
]:- @vocab/[email protected]
@vocab/[email protected]
Patch Changes
- Updated dependencies [
09b7179
]:- @vocab/[email protected]