Skip to content
New issue

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

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

Already on GitHub? # to your account

Special characters are removed #183

Open
JSteunou opened this issue Feb 22, 2021 · 0 comments
Open

Special characters are removed #183

JSteunou opened this issue Feb 22, 2021 · 0 comments

Comments

@JSteunou
Copy link

Describe the bug

Special characters like unicode unbreakable space are removed

How to reproduce

Unbreakable spaces are important in some language like french, because you need a space before exclamation mark for example, but you don't want it to go on the next line and be separated from its previous word.

<Trans i18nKey="foo">bar\u00A0!<Trans> Should be extract as

{
  "foo": "bar\u00A0!"
}

Babel configuration:

cra project with override

        addBabelPlugin([
            'babel-plugin-i18next-extract',
            {
                keySeparator: null,
                outputPath: 'src/locales/{{locale}}/translations.json',
                locales: ['en', 'fr'],
                nsSeparator: '#NSS#',
                jsonSpace: 4,
                defaultValue: '',
                keyAsDefaultValue: ['en'],
            },
        ]),

Reproduction:

<Trans i18nKey="foo">bar\u00A0!<Trans> should be extracted as

Expected behavior

{
  "foo": "bar\u00A0!"
}

What actually happens

but is extracted as

{
  "foo": "bar !"
}

Your environment

  • OS (e.g. ArchLinux): ? Ubuntu 20.04
  • Plugin version (e.g. 0.3.0): ? 0.8.2
  • Node version (e.g. 12.13.0): ? 14.15.4

Additional context

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

No branches or pull requests

1 participant