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

Parser does not add as many translations as it says it did #498

Closed
Heldenkrieger01 opened this issue Dec 28, 2021 · 9 comments
Closed

Parser does not add as many translations as it says it did #498

Heldenkrieger01 opened this issue Dec 28, 2021 · 9 comments

Comments

@Heldenkrieger01
Copy link

馃悰 Bug Report

When running the parser in debug mode, it tells you, how many unique keys it has found and how many new keys it added.
In my project, the parser says it has added 249 keys, but in reality only 227 get written to the output file. This is frustrating, since it seems to pick the translation up, but not actually writing them...

To Reproduce

Multiple files are affected, they contain translation keys like all other files.
I cannot see a pattern.

Expected behavior

All keys are actually added to the output file.

Your Environment

  • runtime version: node v16.10
  • i18next version: 21.6.4
  • i18next-parser version: 5.2.0
  • os: Windows
@karellm
Copy link
Member

karellm commented Mar 13, 2022

@Heldenkrieger01 Can you provide me with a reproduceable example?

@alk-mandrianarijaona
Copy link

I happen to have the same issue on large codebase. The output says that 3448 keys where found but in the output file, there are only 459 items.

Unique keys: 3448 (3618 with plurals)
Added keys: 3159
Restored keys: 0
Removed keys: 0

I tried to reproduce on a new repo but so far I could not reproduce as there are not that much keys.

@alk-mandrianarijaona
Copy link

After bisecting the latest commits, I found out the issue started at 44e44a49989ddbae76c15c0967552ae3b41fb9e9

@alk-mandrianarijaona
Copy link

So as a workaround, I currently use a pinned commit version of i18next-parser by setting "i18next-parser": "https://github.com/i18next/i18next-parser.git#d863cd188a0ae1da68ad455fe39ba33f7db75bc6", in my package.json.

@alk-mandrianarijaona
Copy link

Another workaround here is to keep version 4.7.0 of i18next-parser (which exports all keys as expected) and convert the v3 format output to v4 format using i18next-v4-format-converter

@karellm
Copy link
Member

karellm commented Mar 28, 2022

Could you provide me with a reproducible project? This seems to be a severe bug and I will happily tackle it

@alk-mandrianarijaona
Copy link

@karellm I will try to create a reproduction project. Our project is a private app with 3k+ files and on a small CRA project, I could not reproduce it with the small amount of code there.

@Laityned
Copy link

Laityned commented Apr 3, 2022

Possible related to the same origin of the bug as described in issue #489.

In that case PR #546 would fix this issue.

@karellm
Copy link
Member

karellm commented Apr 3, 2022

This is fixed in 6.2.0. Please not that unique count now includes plurals since it makes more sense with the new plural form.

@karellm karellm closed this as completed Apr 3, 2022
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

4 participants