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

Support i18next JSON v4 format #192

Open
alexander-lebed opened this issue Oct 27, 2022 · 3 comments
Open

Support i18next JSON v4 format #192

alexander-lebed opened this issue Oct 27, 2022 · 3 comments

Comments

@alexander-lebed
Copy link

Thank you for an awesome plugin, I love it!

Recently I migrated my translation keys to new i18next JSON v4 format, but in WebStorm I cannot navigate to such keys anymore and shows it as Unresolved key.

"item" => "item_one"
"item_plural" => "item_other",

image

@nyavro
Copy link
Owner

nyavro commented Oct 27, 2022

Thanks for report!
I'll take a look

@nyavro
Copy link
Owner

nyavro commented Oct 28, 2022

@alexander-lebed are there any changes in json file extensions? JSON v4 looks pretty much the same as older JSON formats, at least in it's structure. So my guess is that your json files have format other than 'json' or 'json5' which are supported by the plugin, so the plugin simply does not see them.

@MadMind
Copy link

MadMind commented Mar 14, 2024

Got the same "Unresolved key" issue with the v4 pluralization keys. For example t('keyName', {count: 5}) shows error, but the translation works as expected.

Translation file example:

{
  "keyName_zero": "{{count}} items",
  "keyName_one": "{{count}} item",
  "keyName_many": "{{count}} items"
}

Docs for reference: https://www.i18next.com/translation-function/plurals#languages-with-multiple-plurals

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

3 participants