In Hebrew there is a dual form for hours, so we have 1, 2, >2, which are a singular form, a dual form and a plural form.
%d hours is wrong in our case (and also in several other languages such as Arabic and Russian) because we need a different case according to the amount of hours.
Making a good translation support with plurals doesn't require low level expertise like all the BLE stuff, but needs someone to go through all places where numbers are handled. Of course, subsequently, this is a another work for translators. I would label this as "help wanted", because this can be good entry point for someone interested. @IzzySoft do you agree?
Indeed @vanous – and done. Curious how this can be solved (was it "paamayim shaot" then, @yarons? And doesn't it get even more complicated considering maskuline forms then, like "raglayim" – or things which come in the dual form by default, like "mikhnasayim"?) – tricky stuff, those languages. In rare cases, there're also dual forms in other languages, which can be even worse: "2 shoes" versus "a pair of shoes"…
I have done some I18L stuff in python but I am not sure how Android is handling this... but in gettext based tooling, the gettext functions are typically assigned to some shorthand: _ = gettext.gettext, which makes applying them easier: out= _('This is a translatable string.') and in case of plurals, you must do all the dance in code with if/case and use gettext.ngettext in those cases.
After quick searching, for Android, https://developer.android.com/guide/topics/resources/string-resource.html#Plurals and this https://stackoverflow.com/questions/34712431/can-plurals-be-translated-in-android might be some reference for those new to the topic in Android (including me).
Translators then must handle all these cases (and if context is right, could do (as you mentioned) pair of something, although i don't think 2 shoes would imply 1 pair :)
This is done with something seemingly called ICU message syntax ( http://userguide.icu-project.org/formatparse/messages ), here link to weblate docs: https://docs.weblate.org/en/latest/user/translating.html#plurals
@IzzySoft LOL, very good!
Pa'amayim Shaot is incorrect, this is actually Sha'atayim.
I will try to give a usage example from other projects, and yes, it will affect all languages (it's a great thing).
@yarons my Hebrew grammar is as rusty as my Hebrew speech. Though I'm always told I have no accent – what please is considered an accent in a country with immigrants in the majority? Not an American accent? Well, that's easy for a Jekke 🤣 It's rather the vocabulary I lack than an accent…
Thanks for the correction! I already wondered how dual was with feminine words. Happens when you rarely speak a language (most dual I experience is at the beemah: "pa'amayim chai" promise during the brachah after an aliyah – no dual on the streets). So easy does it again: just a taw instead of a mem, cool. So "pa'amayim" is only used when explicitly saying "two times X" (or "a pair of X")?
@IzzySoft yup, when you're talking about frequency you are using "Pa'amayim", BTW there's a very famous error in PHP called Paamayim Nekudotayim (should be "Nekudatayim" in proper Hebrew).
There's another dual feminine word in this context: Shnatayim, which means 2 years :)
Yeah, now that you say it I remember that PHP one – second part could have been mine (Nekudot + ayim), but isn't that a twice-double (a pleonasm like in "free gift"), prefixing a dual with a dual? Shnatayim I knew, funny! It just didn't register until now.
But now I have an earwig ("ve-anachnu shnayim…" – Mashina if I remember correctly? 🤣)
@vanous
Thanks for the links, should be enough to do it properly
@yarons
Can you give a specific example? The line numbers you liked are out of bounds ;)
@izzysoft Lol!
Yes, nekudotayim is wrong for this exact reason, you should take the singular and double that instead of the plural form.
That's a very ancient earworm 😂
@ashimokawa
They moved to 734 and 736 respectively, it's 1 hour and %d hours, last string and 3rd from the end. 😀
That's a very ancient earworm :joy:
Indeed. My first thought was: Am I that old already? But then: Mashina is still on stage, and so am I alive and kicking :rofl:
@yarons i didnt realize you are talking about the new strings. The "1 hour" and other minutes settings can be translated as needed in any language, I did it intentionally this way. As for the %d hours, that could be an issue, if you want it to be. Today, I created Czech translation and did %d hour(s) which is mostly correct and takes insomnia into consideration. Considering that this string is taking in "prefered sleep time", it will mostly be hours as in many, rather then one or few/couple, unless you set your preferred sleep for less then 3 hours, but i am worried that in that case, this is the smallest of your issues 😃
Dobré ráno!
(so i contribute to the multilingual discussion here :)
I have added the plural to the widget, thanks @yarons for pointing it out. This seems fairly easy on the programmer in Android, of course, it adds complexity for the translator. (well, as a translator, i can never remember what is meant by "few" in this context... and i must go and research for that project's language...).
So i have added pretty much all options: one, two, few, many, other, although i notice on crowdin and perhaps weblate too that sometimes only one, few and other are being used.
I haven't gone through the project to check other places, please let me know if they exist some place else.
Dobré ráno!
@vanous Is it Czech? It says Good morning or something like that from what I remember from the few Czech lessons I took…
The life of a translator should be easy within the appropriate limitations, taking care of plural, gender and cultural diversity are part of it :)
@IzzySoft I would consider that a blessed experience :smile:
Fix from @vanous is merged, can you try to translate it now on weblate? No idea how it looks there and if it is possible at all
@ashimokawa I just tested on Weblate. They seem to do this differently for different target language, interesting. For Czech, "one, few, other" are used, for Hebrew, "one, two, few, other" is available to translators. Nice, so all seems good.
Thank you all, it works great!
Cool! So would you consider this issue solved, @yarons? If so, please hit the Close button :wink:
Most helpful comment
@vanous Is it Czech? It says Good morning or something like that from what I remember from the few Czech lessons I took…
The life of a translator should be easy within the appropriate limitations, taking care of plural, gender and cultural diversity are part of it :)
@IzzySoft I would consider that a blessed experience :smile: