Open Ixelka opened 5 years ago
@BThibaut thanks for the feedback, the feature would make sense. My only concern is how should plurals look like in the exported files?
I guess depending on the format it could be:
term.one = "{} product"
term.other = "{} products"
...
Although in case someone wants to not use plurals feature, there should be an option to export the "raw" terms, such as:
term = "{} products"
...
How does this look like in the alternatives that you've found?
@anthonynsimon thanks for your interest on this feature.
Actually, .po files handle pluralization like that :
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#:
msgid "user.products"
msgstr[0] "You own {{ count }} product"
msgstr[1] "You own {{ count }} products"
Plural-Forms
is the rule for plurals
msgstr[0], msgstr[1]
are the translations according to the cases in the rule
in this example, it returns 1 where (n > 1)
Also, in my example {{ count }}
is specific to my use case not to .po file format.
Pluralization as asked for in #40 it would be the preferred way imho
@anthonynsimon Do you accept with POEditor concept about ICU message?
I'm still evaluating the options for the pluralisation feature, but as it stands currently we will probably go for some UI components inspired by POEditor on the frontend.
On the backend side, I still gotta review what it would mean in terms of how it plays with the various import/export formats.
Any more suggestions and ideas are more than welcome of course!
Different export formats would require different handling. For instance, here's a chunk of xml for android:
<string name="string1">Check it out!</string>
<plurals name="string2">
<item quantity="one">You\'ve got %s points</item>
<item quantity="other">You\'ve got %s points</item>
</plurals>
iOS has an even more specialized format requiring a separate file for plurals.
Is your feature request related to a problem? Please describe. It's not possible to translate with plural adaptation.
Describe the solution you'd like In the translation list it should be possible to add plural forms according to the language. i.e In french there would be 2 fields : one for 0 and 1 cases and one for > 1 cases These rules are defined for each language and are immutable.
Describe alternatives you've considered At the first time maybe it should be easier to just add plural forms whith 2 forms language.
Additional context The best example I found is the POEditor implementation : There are tabs for each form of plural existing for this language