You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have the need for plural forms in a not so distant future. Only po file support is relevant for us so I'm leaving the CVS format out of my comment for now.
Let's take the example from the po documentation and translate into Elm.
moduleTranslation.Mainexposing (..)
{- "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"-}nplurals =3plural:Int->Intplural n =if n %10==1&& n %100/=11then0else if n %10>=2&& n %10<=4&&(n %100<10|| n %100>=20)then1else2{- #, c-format msgid "One file removed" msgid_plural "%d files removed" msgstr[0] "%d slika je uklonjena" msgstr[1] "%d datoteke uklonjenih" msgstr[2] "%d slika uklonjenih"-}nFilesRemoved:Int->StringnFilesRemoved n =if plural n ==0then
toString n ++" slika je uklonjena"else if plural n ==1then
toString n ++" datoteke uklonjenih"else
toString n ++" slika uklonjenih"
So, what we need is
Parser from C expression to Elm expression for plural function
Parser from Elm expression to C expression for plural function
Handling of if then else and extra number parameter for translations
PO supports plurals officially:
https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-forms.html
We would need to come up with a custom "encoding" for CSV formats.
The text was updated successfully, but these errors were encountered: