i18n-ally icon indicating copy to clipboard operation
i18n-ally copied to clipboard

Support for plurals in i18next v21

Open dantman opened this issue 2 years ago • 12 comments

Is your feature related to a specific framework or general for this extension i18next (v21)

Is your feature request related to a problem? Please describe. If you upgrade to i18next@21 and migrate your messages to the new plural structure i18n Ally will no longer display the message when it's used and will list the valid key under "Keys not found".

Describe the solution you'd like When a key has plurals (_other, _one, etc) display one of those plurals instead of listing the key as nonexistent.

Alternatively i18n Ally could be made smart enough to know about all forms of plurals and allow you to see and edit all of them.

Additional context i18next changed it's plural API. Previously {key} was singular and {key}_plural was plural. So i18n Ally would just display the message at {key}.

The new API is based on the return of the Intl.PluralRules API. Instead {key}_one is singular and {key}_other is plural. As a result there is no longer a single key that exactly matches the key used in t('key') and i18n Ally lists {key} as nonexistent even though it does exist, it just has plurals.

https://www.i18next.com/translation-function/plurals

dantman avatar Nov 05 '21 08:11 dantman

Setting i18n-ally.usage.derivedKeyRules also doesn't seem to work.

dantman avatar Dec 17 '21 23:12 dantman

Was this fixed? Because it looks like even on the latest versions, the extension is unable to detect _one or _other keys even though they exist in all locales.

AmruthPillai avatar Oct 19 '22 10:10 AmruthPillai

Same issue here. Struggling to use i18n ally with i18next 21.x.x caue it makes all my code full of red stuff, not pretty at all

JulesLecuir avatar Oct 27 '22 09:10 JulesLecuir

Same issue here.

marviobezerra avatar Nov 23 '22 22:11 marviobezerra

is there any update on this issue?

auduongtuan avatar Apr 07 '23 13:04 auduongtuan

I am interested as well! It's a pain to have constant errors in my Jetbrains interface just because plurals and contexts are not properly supported...

JulesLecuir avatar Apr 08 '23 14:04 JulesLecuir

I seems that the issue was not fixed yet, reopened.

I am interested as well! It's a pain to have constant errors in my Jetbrains interface just because plurals and contexts are not properly supported...

@JulesLecuir can you report the JetBrains plugin issue as a separate one in this repository, please? https://github.com/lokalise/i18n-ally-jetbrains-docs

terales avatar May 17 '23 07:05 terales

@terales Not sure to understand. My issue is not about docs, rather about i18n-ally not detecting more complex forms of plurals or with context attributes for example. It does not have something to do with docs I guess. So I am wondering if i18n-ally-jetbrains-docs is the right repo to post my issue. Can you confirm ? Thanks !

JulesLecuir avatar May 23 '23 21:05 JulesLecuir

I'm interested in it as well. Any update?

ruiaraujo012 avatar Jun 07 '23 21:06 ruiaraujo012

We're experiencing the same issue still after migrating to the new plural structure. Any updates or progress on this? I haven't found a workaround for this yet either so if anyone knows of one, please let me know.

alpenhannes avatar Dec 22 '23 14:12 alpenhannes

Linking this bug: https://github.com/lokalise/i18n-ally/issues/1002

keithrfung avatar Mar 05 '24 15:03 keithrfung