Releases: seek-oss/vocab
@vocab/[email protected]
@vocab/[email protected]
Minor Changes
-
30d643d
#101 Thanks @askoufis! - Support uploading tags to PhraseTags can be added to an individual key via the
tags
property:// 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
translation keys specified in the file:// translations.json { "_meta": { "tags": ["home_page"] }, "Hello": { "message": "Hello", "tags": ["greeting"] }, "Goodbye": { "message": "Goodbye" } }
In the above example, both the
Hello
andGoodbye
keys would have thehome_page
tag attached to
them, but only theHello
key would have theusage_greeting
tag attached to it.NOTE: Only tags specified on keys in your
devLanguage
will be uploaded. Tags on keys in other
languages will be ignored.
Patch Changes
-
fc74024
#99 Thanks @askoufis! - Exclude source files from package build -
Updated dependencies [
30d643d
,fc74024
]:- @vocab/[email protected]
- @vocab/[email protected]
@vocab/[email protected]
Minor Changes
-
30d643d
#101 Thanks @askoufis! -loadTranslation
,loadAllTranslations
: Support loading translations with or without tagsTags can be conditionally loaded alongside translations by specifying the appropriate
withTags
value.
By default, tags will not be loaded. Tags will also never be loaded for non-dev languages.EXAMPLE USAGE:
import type { UserConfig } from '@vocab/types'; import { loadTranslation, loadAllTranslations } from '@vocab/core'; const userConfig: UserConfig = { devLanguage: 'en', languages: [{ name: 'en' }, { name: 'th' }], }; const translations = loadTranslation( { filePath: '/path/to/translations.json', fallbacks: 'valid', withTags: true, }, userConfig, ); const allTranslations = loadAllTranslations( { fallbacks: 'valid', includeNodeModules: false, withTags: true }, userConfig, );
Patch Changes
- Updated dependencies [
fc74024
]:- @vocab/[email protected]
@vocab/[email protected]
Minor Changes
-
30d643d
#101 Thanks @askoufis! - Support uploading tags to PhraseTags can be added to an individual key via the
tags
property:// 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
translation keys specified in the file:// translations.json { "_meta": { "tags": ["home_page"] }, "Hello": { "message": "Hello", "tags": ["greeting"] }, "Goodbye": { "message": "Goodbye" } }
In the above example, both the
Hello
andGoodbye
keys would have thehome_page
tag attached to
them, but only theHello
key would have theusage_greeting
tag attached to it.NOTE: Only tags specified on keys in your
devLanguage
will be uploaded. Tags on keys in other
languages will be ignored.
Patch Changes
-
fc74024
#99 Thanks @askoufis! - Exclude source files from package build -
Updated dependencies [
30d643d
,fc74024
,30d643d
]:- @vocab/[email protected]
- @vocab/[email protected]
@vocab/[email protected]
@vocab/[email protected]
Patch Changes
-
e5a066c
#96 Thanks @askoufis! - Updateintl-messageformat
dependencies -
Updated dependencies [
e5a066c
]:- @vocab/[email protected]
@vocab/[email protected]
Patch Changes
-
e5a066c
#96 Thanks @askoufis! - Updateintl-messageformat
dependencies -
Updated dependencies [
e5a066c
]:- @vocab/[email protected]
@vocab/[email protected]
Minor Changes
-
66ed22c
#93 Thanks @askoufis! - Add an optionaldeleteUnusedKeys
flag to thepush
function. If set totrue
, unused keys will be deleted from Phrase after translations are pushed.EXAMPLE USAGE:
import { push } from '@vocab/phrase'; const vocabConfig = { devLanguage: 'en', language: ['en', 'fr'], }; await push({ branch: 'myBranch', deleteUnusedKeys: true }, vocabConfig);
Patch Changes
@vocab/[email protected]
Minor Changes
-
66ed22c
#93 Thanks @askoufis! - Add an optionaldelete-unused-keys
flag to thepush
command. If set totrue
, unused keys will be deleted from Phrase after translations are pushed.EXAMPLE USAGE:
vocab push --delete-unused-keys
Patch Changes
- Updated dependencies [
66ed22c
,159d559
]:- @vocab/[email protected]
@vocab/[email protected]
Patch Changes
09a698a
#89 Thanks @mikebarkmin! - Add exports to packages with multiple entry points. This fixes
ERR_UNSUPPORTED_DIR_IMPORT
issues e.g. with NextJS or other setups, which
rely on the new node resolver when using ESM packages.- Updated dependencies [
09a698a
]:- @vocab/[email protected]