Skip to content

Releases: i18next/i18next-scanner

v2.3.1

20 Jan 03:52
Compare
Choose a tag to compare

Support context and count options for Trans (e3b8733, resolves #70, PR #71 by @wichert)

v2.3.0

12 Jan 06:45
Compare
Choose a tag to compare

Adds a new option (lineEnding) to specify the line endings (817ca49, PR #68)

{
  resource: {
    // Normalize line endings to '\r\n', '\r', '\n', or 'auto' for the current operating system. Defaults to '\n'.
    // Aliases: 'CRLF', 'CR', 'LF', 'crlf', 'cr', 'lf'
    lineEnding: '\n'
  }
}

v2.2.1

27 Nov 22:57
Compare
Choose a tag to compare
  • Ignore keys with embedded expressions in string literals (2379482, resolves #62)

v2.2.0

25 Nov 12:22
5cbc63b
Compare
Choose a tag to compare
  • Add a trans option for specifying extensions and fallbackKey:
{
    trans: {
        extensions: ['.js', '.jsx'],
        fallbackKey: false // Defaults to false
    }
}

Available options for fallbackKey:

  • Pass true to return the content as key.
  • Specify a function to return user-defined key:
    // @param {string} ns The namespace currently used.
    // @param {string} value The value.
    // @return {string} Returns a translation key for the given value.
    fallbackKey: function(ns, value) {
        return value;
    }

v2.1.5

22 Nov 15:37
Compare
Choose a tag to compare

Move 'chalk' dependency to dependencies instead of devDependencies (db1f800, PR #60)

v2.1.4

22 Nov 14:38
Compare
Choose a tag to compare

Adds missing dependency 'commander' (92fd86a, PR #59)

v2.1.3

22 Nov 09:38
Compare
Choose a tag to compare

Add backtick support (7cc8ce7, PR #57)

i18n.t(`added {{foo}}
 and {{bar}}`, { foo: '', bar: '' });

will turn into:

{
    "added {{foo}}\n and {{bar}}": ""
}

v2.1.2

17 Nov 05:53
Compare
Choose a tag to compare
  • Improve handling of default values (PR #55, @wichert )
  • Fix handling of HTML entities in JSX parsing (PR #56, @wichert)

v2.1.1

10 Nov 03:43
Compare
Choose a tag to compare

Fixed an installation issue of missing cli (fca8be1, PR #53)

v2.1.0

07 Nov 06:45
f81bd6d
Compare
Choose a tag to compare

Add CLI support (#48)

$ i18next-scanner

  Usage: i18next-scanner [options] <file ...>


  Options:

    -V, --version      output the version number
    --config <config>  Path to the config file (default: i18next-scanner.config.js)
    --output <path>    Path to the output directory (default: .)
    -h, --help         output usage information

  Examples:

    $ i18next-scanner --config i18next-scanner.config.js --output /path/to/output 'src/**/*.{js,jsx}'
    $ i18next-scanner --config i18next-scanner.config.js 'src/**/*.{js,jsx}'
    $ i18next-scanner '/path/to/src/app.js' '/path/to/assets/index.html'