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

Fail on update does not work with multiple namespaces #489

Closed
AnotherHermit opened this issue Dec 9, 2021 · 4 comments
Closed

Fail on update does not work with multiple namespaces #489

AnotherHermit opened this issue Dec 9, 2021 · 4 comments

Comments

@AnotherHermit
Copy link

馃悰 Bug Report

When using multiple namespaces along with the "--fail-on-update" flag the result is always flagged as updated.
The issue seems to be the countWithPlurals that is used to check how many keys were added to a specific namespace. Since the countWithPlurals is set for the whole locale, not the specific namespace, the addCount for the namespace is wrong.
This can also be seen when the verbose setting is enabled, then the added keys will list the total number of keys for the locale minus the keys added in the specific namespace.

To Reproduce

  1. Use a setup with multiple namespaces with different keys in the different namespaces
  2. Extract the keys once
  3. Enable --fail-on-update (and verbose to see that the added keys is not 0)
  4. Output will be flagged as having updates, even though output is the same

Expected behavior

Fail on update should not always fail when run in environments with multiple namespaces

Your Environment

  • runtime version: node 16.5.0
  • i18next version: 21.5.4
  • i18next-parser version: 5.3.0
  • os: Linux (WSL)
@riccardo-forina
Copy link

I'm hitting this too.

@karellm
Copy link
Member

karellm commented Dec 18, 2021

I'll happily review a PR if you want to take a spin at fixing this.

@karellm
Copy link
Member

karellm commented Apr 3, 2022

This is likely 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
@alk-mandrianarijaona
Copy link

@karellm unfortunately upgrading to 6.2.0 does not solve my issue yet but I was not able to reproduce it in a new project with the same config as my private project. I will reopen later if I can find a way to reproduce it. Thanks 馃檹馃徏

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