Skip to content

Releases: i18next/i18next-scanner

v4.6.0

14 Oct 15:30
138825a
Compare
Choose a tag to compare

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

v4.5.0

14 Jun 05:24
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.4.0...v4.5.0

v4.4.0

25 Aug 18:41
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.3.0...v4.4.0

v4.3.0

11 Jul 07:19
Compare
Choose a tag to compare

What's Changed

  • refactor: remove the traverse code in parseJSXElement to eliminate redundant calls for setting translation keys by @cheton in #250
  • chore: bump vinyl and vinyl-fs to the latest release to fix vulnerability issue by @cheton in d54293b
  • refactor: call the defaultValue helper to determine the value of a translation key when parsing Trans components by @cheton in bcfd2cd

Full Changelog: v4.2.0...v4.3.0

v4.2.0

19 Mar 05:40
Compare
Choose a tag to compare

What's Changed

  • feat: add possibility to pass RegExp to trans.component by @kirillku in #244

Full Changelog: v4.1.3...v4.2.0

v4.1.3

19 Mar 05:37
Compare
Choose a tag to compare

What's Changed

  • fix: do not show log message when defaultValue returns undefined by @kirillku in #246

New Contributors

Full Changelog: v4.1.2...v4.1.3

v4.1.2

17 Jan 16:47
Compare
Choose a tag to compare

What's Changed

  • fix: fix array duplication after parse by @Zwooosh in #238

New Contributors

Full Changelog: v4.1.1...v4.1.2

v4.1.1

17 Jan 16:44
Compare
Choose a tag to compare

What's Changed

  • refactor: improve JSX parser to parse boolean props by @geewoo94 in #241

New Contributors

Full Changelog: v4.1.0...v4.1.1

v4.1.0

14 Oct 14:37
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.0.0...v4.1.0

v4.0.0

08 Jul 12:59
9e91b0c
Compare
Choose a tag to compare

What's Changed

  • feat: migrate from Tap to Jest by @cheton in #220

  • feat: rework the nodesToString function to output expected element index or tag name by @cheton in #234

    Adds supportBasicHtmlNodes and keepBasicHtmlNodesFor options to the trans object that supports for simple html elements. Learn more

    trans: {
      supportBasicHtmlNodes: true, // Enables keeping the name of simple nodes (e.g. <br/>) in translations instead of indexed keys.
      keepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'], // Which nodes are allowed to be kept in translations during defaultValue generation of <Trans>.
    }

Full Changelog: v3.3.0...v4.0.0