Comments (8)
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.
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.
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.
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.
the or:
en: key, key_plural will be automatically toggled to key_0, key_1,...key_5 in arabic:
from i18next-intervalplural-postprocessor.
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.
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.
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)
- interval Plural not working properly. HOT 1
- Plural fallback with namespace fails HOT 6
- Regex Expression does not handle whitespace characters HOT 5
- Negative count and negative infinity HOT 3
- Interpolation in an interval HOT 3
- Can we support TS? HOT 2
- Linebreak doesn't work HOT 2
- Doesn't fallback to classic plural HOT 2
- Combine with context HOT 3
- Support for enumeration?
- What changed in version 2 HOT 1
- Typescript check error after upgrade to 2.0.0 or 2.0.1 HOT 2
- Translation interval with the variable not working HOT 1
- using `postProcess: 'interval'` in `i18next.init` fails HOT 3
- postProcessor no longer works on i18next v21.* HOT 3
- intervalPlural.setOptions doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18next-intervalplural-postprocessor.