Skip to content

Releases: seek-oss/vocab

@vocab/[email protected]

13 Feb 03:25
9f03d18
Compare
Choose a tag to compare

Patch Changes

@vocab/[email protected]

13 Feb 03:25
9f03d18
Compare
Choose a tag to compare

Minor Changes

  • 30d643d #101 Thanks @askoufis! - Support uploading tags to Phrase

    Tags 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 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 will be uploaded. Tags on keys in other
    languages will be ignored.

Patch Changes

@vocab/[email protected]

13 Feb 03:25
9f03d18
Compare
Choose a tag to compare

Minor Changes

  • 30d643d #101 Thanks @askoufis! - loadTranslation, loadAllTranslations: Support loading translations with or without tags

    Tags 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

@vocab/[email protected]

13 Feb 03:25
9f03d18
Compare
Choose a tag to compare

Minor Changes

  • 30d643d #101 Thanks @askoufis! - Support uploading tags to Phrase

    Tags 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 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 will be uploaded. Tags on keys in other
    languages will be ignored.

Patch Changes

@vocab/[email protected]

13 Jan 03:05
95910b4
Compare
Choose a tag to compare

Patch Changes

@vocab/[email protected]

13 Jan 03:05
95910b4
Compare
Choose a tag to compare

Patch Changes

@vocab/[email protected]

13 Jan 03:05
95910b4
Compare
Choose a tag to compare

Patch Changes

@vocab/[email protected]

20 Sep 06:05
480b96e
Compare
Choose a tag to compare

Minor Changes

  • 66ed22c #93 Thanks @askoufis! - Add an optional deleteUnusedKeys flag to the push function. If set to true, 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

  • 159d559 #91 Thanks @askoufis! - Improve error message when Phrase doesn't return any translations for the dev language

@vocab/[email protected]

20 Sep 06:05
480b96e
Compare
Choose a tag to compare

Minor Changes

  • 66ed22c #93 Thanks @askoufis! - Add an optional delete-unused-keys flag to the push command. If set to true, unused keys will be deleted from Phrase after translations are pushed.

    EXAMPLE USAGE:

    vocab push --delete-unused-keys

Patch Changes

@vocab/[email protected]

18 Aug 03:37
5057646
Compare
Choose a tag to compare

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]: