Skip to content

Releases: i18next/i18next-scanner

v2.0.4

07 Nov 03:07
Compare
Choose a tag to compare

Refine the regular expression to match white spaces and new lines (50a10d6, #50)

Example:

i18next.t(
    'my_translation_key'
);

v2.0.3

07 Nov 02:31
Compare
Choose a tag to compare

Use htmlparser2 to parse JSX (ca44678, PR #52, @wichert)

v2.0.2

01 Nov 16:43
Compare
Choose a tag to compare

Deeply sort an object by its keys (ca3b0ff, #49)

v2.0.1

31 Oct 09:45
Compare
Choose a tag to compare

Slim down NPM package (9644519, PR #47)

v2.0.0

16 Sep 13:28
Compare
Choose a tag to compare

Support react-i18next <Trans> components (PR #44, Thanks @wichert )

v1.9.4

13 Aug 14:50
Compare
Choose a tag to compare

The plural and context options can now be a user defined function that returns boolean (4676b48)

context: function(lng, ns, key, options) {
    return true;
},
plural: function(lng, ns, key, options) {
    return true;
}

v1.9.3

12 Aug 15:53
Compare
Choose a tag to compare

Add a propsFilter callback to the options object of parseFuncFromString to filter the props string (7de861b)

const options = {
    // Replace all special characters from string.
    // Example: JsRender Helper
    // {{:~i18n('For details, see the help page at ${url}.', { 'url': #data['url'] })}}
    propsFilter: (s) => { // s = "{ 'url': #data['url'] }"
        return s.replace(/#/g, ''); // "{ 'url': data['url'] }"
    }
};

parser.parseFuncFromString(code, options, (key, options) => {
    const defaultValue = key;
    parser.set(key, {
         ...options,
         defaultValue: defaultValue,
         nsSeparator: false,
         keySeparator: false
    });
});

v1.9.2

11 Aug 16:01
Compare
Choose a tag to compare

Fixed a bug when passing empty attributes or functions to parseAttrFromString or parseFuncFromString will produce incorrect result (dae7ab6)

v1.9.1

26 Jul 15:52
Compare
Choose a tag to compare

PR #42: Extract values from properties if type is template literal (6829ebe)

v1.9.0

15 Jul 15:43
Compare
Choose a tag to compare

Supports backslashed multiline string literal keys (PR #41 by @rformato)

Examples:

i18next.t('this is \
a multiline \
string');

i18next.t("this is \
another multiline \
string");