Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parseTransFromString output the nested tags twice each in the Trans component. #229

Closed
gomo opened this issue Apr 30, 2022 · 1 comment · Fixed by #234
Closed

The parseTransFromString output the nested tags twice each in the Trans component. #229

gomo opened this issue Apr 30, 2022 · 1 comment · Fixed by #234

Comments

@gomo
Copy link

gomo commented Apr 30, 2022

🐛 Bug Report

The parseTransFromString output the nested tags twice each in the Trans component.

To Reproduce

    parser.parseTransFromString('<Trans i18nKey="foo"><Text>{{email}}</Text>foobar</Trans>', { component: 'Trans', i18nKey: 'i18nKey'}, function(key, options){
      console.log(key, options)
    })

This code output the following.

foo {
  defaultValue: '<0><0>{{email}}</0></0>foobar',
  fallbackKey: undefined
}

Expected behavior

It should output the following.

foo {
  defaultValue: '<0>{{email}}</0>foobar',
  fallbackKey: undefined
}

Your Environment

  • runtime version: node v16.13.1
  • i18next version: i.e. 21.6.14
  • os: Mac 12.2.1 (21D62) CPU M1
@cheton
Copy link
Member

cheton commented Jul 8, 2022

Published v4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants