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

Plural keys not detected anymore when count is an expression #1015

Closed
cochery opened this issue Jun 20, 2024 · 3 comments
Closed

Plural keys not detected anymore when count is an expression #1015

cochery opened this issue Jun 20, 2024 · 3 comments

Comments

@cochery
Copy link

cochery commented Jun 20, 2024

💥 Regression Report

t('mykey', '{{count}} something', { count: expression() }) used to be extracted as 2 plural keys, but the plural form isn't detected anymore.

t('mykey', '{{count}} something', { count: value }) is still extracted as 2 plural keys.

Last working version

Worked up to version: 8.13.0

Stopped working in version: 9.0.0

To Reproduce

Steps to reproduce the behavior:

function expression() {
  return 1;
}
`t('mykey', '{{count}} something', { count: expression() })`

Only one key mykey is extracted.

Expected behavior

2 keys mykey_one and mykey_other should be extracted in English. That was the former behaviour and still works when count is a value and not an expression.

Probably introduced by #994

Your Environment

  • runtime version: node v20.10.0
  • i18next version: i.e. 23.11.5
  • os: Mac
@Zerebokep
Copy link

Same here after updating to 9.0.0.

@glsignal
Copy link
Contributor

Ran into this issue as well. I opened a PR with a patch here -> #1022

@karellm
Copy link
Member

karellm commented Jul 27, 2024

This is now part of 9.0.1.

@karellm karellm closed this as completed Jul 27, 2024
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