asterics / AsTeRICS-Grid

Free and simple to use app for augmentative and alternative communication (AAC) with offline support, flexible input methods and media access
https://grid.asterics.eu/
GNU Affero General Public License v3.0
57 stars 20 forks source link

String "elements" should be plural #334

Open mtrakal opened 1 year ago

mtrakal commented 1 year ago

On some places is used text like "250 elements", but it should be plular string in that case.

Crowdin: https://crowdin.com/translate/asterics-grid/14/en-cs#1784

Current state: I'm not able to properly translate this string, because in Czech we use more variants (the same will be in Polish, Slovak almost any other language).

0 prvkŮ 1 prvEk 2 prvkY 3 prvkY 4 prvkY 5 prvkŮ 1000 prvkŮ

plural for {zero}, {one}, {few}, {many}, {others} (based on country): https://localizely.com/language-plural-rules/

On image is shown: 250 prvky but should be 250 prvků but if I translate it to prvků it will not work for 1-4 elements.

image image

klues commented 1 year ago

OK, I understand the problem, but I think it's not trivial to fix it.

According to my short investigation:

So probably this would be the way to go, however it's some effort to implement where I currently don't have the ressources for it. But you're welcome to try it and to open a PR if it's successful. Otherwise I think we have to live with imperfect translation for now. But in general great, that you're translating the app to Czech! 👍

mtrakal commented 1 year ago

Corwdin supports plurals by default, which looks really named ICU Plurals: image

When you have access to Arasaac crowdin: https://crowdin.com/translate/arasaac/14/en-cs#3172

I think it should be used: https://kazupon.github.io/vue-i18n/guide/pluralization.html#accessing-the-number-via-the-pre-defined-argument pluralization not custom formatting.

I'm sorry, but I'm not a JS developer, it's too far from by my scope (Android in Kotlin). So I can create more issues, than help :)

Sure, it's ok to use it as is now with just one type (non-pluralization), it's just way how to improve it :)

klues commented 1 year ago

I think it should be used: https://kazupon.github.io/vue-i18n/guide/pluralization.html#accessing-the-number-via-the-pre-defined-argument pluralization not custom formatting.

I've also seen this, but the pluralization format in vue-i18n looks very different from that supported by crowdin, so I don't see how to directly combine them. Maybe the way to go is to write some javascript within a custom pluralization which parses the ICU format from crowdin.