Releases: i18next/i18next-scanner
v4.6.0
What's Changed
-
refactor: allow the
removeUnusedKeys
function to be passed in to determine if an unused key should be removed by @yocarbo in #262Set 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
What's Changed
- Fix README link by @Maxou44 in #253
- feat(parser): Handle a few more use cases of potential count attributes. by @vincentdesmares in #260
New Contributors
- @Maxou44 made their first contribution in #253
- @vincentdesmares made their first contribution in #260
Full Changelog: v4.4.0...v4.5.0
v4.4.0
What's Changed
- Update parser to support multiple fallback keys by @scottgonzalez in #251
- Support new plural suffixes with JSON v4 format by @scottgonzalez in #252
New Contributors
- @scottgonzalez made their first contribution in #251
Full Changelog: v4.3.0...v4.4.0
v4.3.0
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 parsingTrans
components by @cheton in bcfd2cd
Full Changelog: v4.2.0...v4.3.0
v4.2.0
v4.1.3
v4.1.2
v4.1.1
v4.1.0
What's Changed
- Update conflicting default translation message by @hogansghost in #236
New Contributors
- @hogansghost made their first contribution in #236
Full Changelog: v4.0.0...v4.1.0
v4.0.0
What's Changed
-
feat: rework the
nodesToString
function to output expected element index or tag name by @cheton in #234Adds
supportBasicHtmlNodes
andkeepBasicHtmlNodesFor
options to thetrans
object that supports for simple html elements. Learn moretrans: { 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