Skip to content

Releases: i18next/i18next-scanner

v2.6.1

26 Jun 03:24
0eaa7e9
Compare
Choose a tag to compare

Bug Fixes

[Trans Component] Do not separate the fallback key with keySeparator (e5d4f50, PR #84)

v2.6.0

25 Jun 11:05
Compare
Choose a tag to compare

Parse Trans component with Acorn-JSX parser (a18c743, closes #72, #73, #75)

jsx:

<Trans>
    multiline
    text
    string
</Trans>
<Trans>This is a <strong>test</strong></Trans>
<Trans>This is a <strong>{{test}}</strong></Trans>
<Trans>
    2 + 2 = {{ result: 2 + 2 }}
</Trans>
<Trans>
    Go to <Anchor href="/administration/tools">Administration > Tools</Anchor> to download administrative tools.
</Trans>
<Trans>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    <p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>
</Trans>
<Trans>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    <p>
        Lorem Ipsum is simply dummy text of the printing and typesetting industry.
        <p>
            {'Lorem Ipsum is simply dummy text of the printing and typesetting industry.'}
        </p>
    </p>
    <p>
        Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
    </p>
</Trans>

results in strings:

"multiline text string"
"This is a <1>test</1>"
"This is a <1><0>{{test}}</0></1>"
"2 + 2 = <1>{{result}}</1>"
"Go to <1>Administration > Tools</1> to download administrative tools."
"<0>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</0>Lorem Ipsum is simply dummy text of the printing and typesetting industry.<2>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</2>"
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.<1>Lorem Ipsum is simply dummy text of the printing and typesetting industry.<1>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</1></1><2>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</2>"

v2.5.0

09 Jun 00:34
Compare
Choose a tag to compare

Adds support for react-i18next Trans' defaults (PR #83, 31c9e59, by @beheh)

react-i18n v7.7.0 introduced the defaults prop, see i18next/react-i18next#439 (comment).

The following code:

<Trans
  defaults="Hello <0>{val}</0>!"
  tOptions={{val: "World"}}
  components=[<strong>foo</strong>]
/>

will lead to the output:

{
  "Hello <0>{val}</0>!": "Hello <0>{val}</0>!"
}

v2.4.6

06 Mar 04:01
Compare
Choose a tag to compare
  • Allow to scan html <template> files. (fixes #77, PR #78 by @Jule-)
  • Allow to use 3rd argument customHandler as mentioned in the documentation. (fixes #76, PR #78 by @Jule-)

v2.4.5

02 Mar 11:15
Compare
Choose a tag to compare

Fix support for single quotes (4ef36dc, #74 by @messerm)

v2.4.4

04 Feb 05:26
Compare
Choose a tag to compare

Addresses an issue on Windows where arguments contain spaces must be enclosed with double quotes, not single quotes (a5be5b8)

v2.4.3

01 Feb 05:22
Compare
Choose a tag to compare

Fixed a runtime error where Buffer.from(string[, encoding]) is not supported in Node.js v5.9 and earlier versions (1a089a6)

v2.4.2

21 Jan 05:06
Compare
Choose a tag to compare

Improvements

  • Resolves an issue where the 'removeUnusedKeys' option may re-order keys in the translation file (a6fa06c, #64)

Dependencies

  • deps: lodash@^4.0.0
  • deps: parser5@^4.0.0

v2.4.1

20 Jan 09:48
Compare
Choose a tag to compare

Adds a "defaultLng" option for checking default values (891fa2c, closes #69)

v2.4.0

20 Jan 05:04
Compare
Choose a tag to compare

Support different component name and i18n key for Trans component (b01b898, #70)

trans: {
    component: 'Trans',
    i18nKey: 'i18nKey',
    extensions: ['.js', '.jsx'],
    fallbackKey: true
}