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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converter can't handle keys with underscores #98

Closed
rebeccaalpert opened this issue Nov 4, 2020 · 1 comment
Closed

Converter can't handle keys with underscores #98

rebeccaalpert opened this issue Nov 4, 2020 · 1 comment

Comments

@rebeccaalpert
Copy link
Contributor

馃悰 Bug Report

It seems like keys can't contain underscores.

To Reproduce

We have a JSON file that contains the following:

"Label name must not begin with a digit and contain only alphanumeric characters or '_'.": "Label name must not begin with a digit and contain only alphanumeric characters or '_'.",

After you run i18nextToPo('ja', fs.readFileSync(file), { language: 'ja', foldLength: 0 }).then( save(...));, you get something like this:

msgctxt "'."
msgid "Label name must not begin with a digit and contain only alphanumeric characters or '"
msgstr ""

Expected behavior

The expected PO file would look like this:

msgid "Label name must not begin with a digit and contain only alphanumeric characters or '_'."
msgstr ""

Your Environment

  • runtime version: node 10.16.2
  • i18next version: 19.4.3
  • os: Mac
@rebeccaalpert
Copy link
Contributor Author

Posted too soon. I suspect this is due to the default context separator. I'll see if we can switch ours to something else or escape these.

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

No branches or pull requests

1 participant