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