Skip to content

v4.6.0

Latest
Compare
Choose a tag to compare
@cheton cheton released this 14 Oct 15:30
138825a

What's Changed

  • ci: add test with node runtime 18 and 20 by @lowsky in #259

  • refactor: allow the removeUnusedKeys function to be passed in to determine if an unused key should be removed by @yocarbo in #262

    Set to true to remove unused translation keys from i18n resource files. By default, this is set to false.

    { // Default
      removeUnusedKeys: false,
    }

    If a function is provided, it will be used to decide whether an unused translation key should be removed.

    // Available since 4.6.0
    //
    // @param {string} lng The language of the unused translation key.
    // @param {string} ns The namespace of the unused translation key.
    // @param {array} key The translation key in its array form.
    // @return {boolean} Returns true if the unused translation key should be removed.
    removeUnusedKeys: function(lng, ns, key) {
      if (ns === 'resource') {
        return true;
      }
      return false;
    }

New Contributors

Full Changelog: v4.5.0...v4.6.0