Skip to content

Releases: i18next/i18next-scanner

v1.2.0

02 May 11:34
Compare
Choose a tag to compare

#28 - Adds support for parsing Context & Plural syntax

Options

API

class Parser {
  // @param {string} key The translation key
  // @param {object} [options] The options object
  // @param {string} [options.defaultValue] defaultValue to return if translation not found
  // @param {number} [options.count] count value used for plurals
  // @param {string} [options.context] used for contexts (eg. male)
  set(key, options) {
  }
}

v1.1.0

08 Apr 05:28
Compare
Choose a tag to compare

Fixes issue #27 - Disabiling nsSeparator breaks the defaultValue fallback

Now the defaultValue option can either be a string or a function. For example:

  • Provides the default value with a string
{
    defaultValue: '__NOT_TRANSLATED__'
}
  • Provides the default value as a callback function
{
    // @param {string} lng The language currently used.
    // @param {ns} ns The namespace currently used.
    // @param {key} key The translation key.
    // @return {string} Returns a default value for the translation key.
    defaultValue: function(lng, ns, key) {
        if (lng === 'en') {
            // Return key as the default value for English language
            return key;
        }
        // Return the string '__NOT_TRANSLATED__' for other languages
        return '__NOT_TRANSLATED__';
    }
}

v1.0.2

31 Mar 14:07
Compare
Choose a tag to compare

Fixes #25 - Error when comparing file extensions in transform function

v1.0.1

19 Mar 15:25
Compare
Choose a tag to compare

Backward compatibility for Node.js v0.10 and v0.12

v1.0.0

15 Mar 10:11
Compare
Choose a tag to compare

There is a major breaking change since v1.0, and the API interface and options are not compatible with v0.x.

Checkout Migration Guide for doing migration from earlier versions.

v0.6.1

15 Mar 09:04
Compare
Choose a tag to compare

This update contains a bug fixes for

  • #24 Fix the grunt task - Wait for all files to be written before finish the task. (by @Xevi)

v0.6.0

12 Mar 16:27
Compare
Choose a tag to compare

#21 Add support to disable nsseparator and keyseparator

See Key Based Fallback at http://i18next.com/translate/keyBasedFallback/

v0.5.9

07 Mar 16:10
Compare
Choose a tag to compare

Remove unnecessary dependencies: i18next, i18next-text

v0.5.8

10 Dec 10:17
Compare
Choose a tag to compare

Fixed a bug that the callback of the end event will be never called while using vinyl-fs v1.x and above.

v0.5.7

10 Dec 09:38
Compare
Choose a tag to compare

Rollback vinyl-fs from v2.2.1 to v0.3.14 to avoid build error with Grunt