Git Product home page Git Product logo

Comments (8)

josephmcasey avatar josephmcasey commented on June 14, 2024

I might also add that it would be nice if the recommended in this issue could be added to the I18Next plural documentation for others, or it could be a console warning when users like myself only add intervals for 0 or 1.

from i18next-intervalplural-postprocessor.

jamuhl avatar jamuhl commented on June 14, 2024

hm...not sure but for the case described above why not just using the regular plural?

https://www.i18next.com/plurals.html#languages-with-multiple-plurals

interval plurals fallback to regular plural if not having a value in the defined ranges. Basically the interval plurals are more to specify plural texts in form of "we got a few items" and "we have a lot of items"

regular plurals:

**Arabic**

"key_0" : "دقيقة"
"key_1": "دقيقة"
"key_2": "دقيقتان"
"key_3": "{{count}} دقائق"
"key_4": "{{count}} دقائق"
"key_5": "{{count}} دقيقة"

// -> not sure if the forms are are correct...but rules are here: https://www.i18next.com/plurals.html#how-to-find-the-correct-plural-suffix

**English**

"key": "{{count}} minute"
"key_plural": "count minutes"

from i18next-intervalplural-postprocessor.

jamuhl avatar jamuhl commented on June 14, 2024

the regular plural will also be automatically generated for other languages in locize - while we can't guess which intervals makes sense in other languages

from i18next-intervalplural-postprocessor.

josephmcasey avatar josephmcasey commented on June 14, 2024

I might be mistaken about everything you said, so correct me if I am wrong.

I think you're saying that, my reference language being English, I only require the following.

**English**

"key": "{{count}} minute"
"key_plural": "count minutes"

If and when I run into languages with more plurals forms than English, I have to manually maintain each of their various plural individually as a superset to the plurals my reference language supports like this?

**Arabic**

"key_0" : "دقيقة"
"key_1": "دقيقة"
"key_2": "دقيقتان"
"key_3": "{{count}} دقائق"
"key_4": "{{count}} دقائق"
"key_5": "{{count}} دقيقة"

"key": "{{count}} دقيقة"
"key_plural": "{{count}} دقيقة"

Or are you saying that I would intentionally not populate the values for my plural and implicit singular keys, having disparate keys depending on the plural forms support by each language like this:

**Arabic**

"key_0" : "دقيقة"
"key_1": "دقيقة"
"key_2": "دقيقتان"
"key_3": "{{count}} دقائق"
"key_4": "{{count}} دقائق"
"key_5": "{{count}} دقيقة"

from i18next-intervalplural-postprocessor.

jamuhl avatar jamuhl commented on June 14, 2024

the or:

en: key, key_plural will be automatically toggled to key_0, key_1,...key_5 in arabic:

screen shot 2017-10-25 at 20 59 05

from i18next-intervalplural-postprocessor.

josephmcasey avatar josephmcasey commented on June 14, 2024

Wow, I see.

It seems that I have misused the intended purpose of the interval post processor, and I was unaware that adding a language on Locize.io would add the plurals automatically.

Since the concept of "zero" in English is discussed inconsistently depending on the context, I utilized a count of "0 Minutes" to instead be represented as "< 1 Minute".

Unfortunately, that means the _interval key is added to Arabic where the concept of zero is handled perhaps more consistently, not that I would know.

I think the answer is that in languages with multiple plurals the interval keys are usually expected to only be represented in languages with only limited plural forms, like English.

from i18next-intervalplural-postprocessor.

jamuhl avatar jamuhl commented on June 14, 2024

honestly i got no idea...i can speak a few languages...but all come from roman or germanic language roots (german, english, french, italian)...so i really can't express what the multiple plurals in eg. arabic or russian express...neither why most asiatic languages not even have plural forms...all rather strange...;)

from i18next-intervalplural-postprocessor.

jamuhl avatar jamuhl commented on June 14, 2024

but yeah...interval might be more for the english, and similar languages to express zero, few, that might or not might be handled already in the other languages having multiple plurals...

from i18next-intervalplural-postprocessor.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.