Post by akerbeltz » Sat Dec 08, 2012 8:28 pm

Hi we've been asked by our speaker community to localize OpenCart and I have a question about plural formatting and I can't find a forum post which addresses this issue.

Different languages uses different plural patterns, some like English, have a 1 and more than one approach (2 plurals) but others get very elaborate, especially (from the European POV) Celtic and Slavonic languages. In my case, Scottish Gaelic, we need 4 plurals, otherwise anything with a number placeholder looks silly. A bit like "you have 1 items in your basket".

Unfortunately they're not always in numerical order, i.e. in our case, one form is used for 1, 11, another for 2, 12, the third for 3-10 and 13-19 and form 4 for the rest. This means you can't just put that into the code manually for such languages.

One way would be using gettext I guess (which could also solve the issue of maintaining translations centrally which I've seen mentioned elsewhere) i.e. by shifting translation onto a central pootle server. That would also prevent translators from accidentally breaking the code and make updating strings easy.

In any case, in the current setup where you grab the php files and just start translating them manually, is there a way OpenCart has dealt with plurals that I've missed?

Thanks!

Do, or do not. There is no try.


User avatar
Newbie

Posts

Joined
Thu Dec 06, 2012 10:46 pm

Post by akerbeltz » Thu Aug 28, 2014 3:31 am

Just come across this in checkout/cart.php
%s every %d %s(s) for %d payment(s) then
Sorry but who's smoking too much weed here? How is anyone a) supposed to translate that and b) will someone point out to the developers that slapping a letter on for plurals does NOT work in most languages? Pretty please?

Do, or do not. There is no try.


User avatar
Newbie

Posts

Joined
Thu Dec 06, 2012 10:46 pm

Post by akerbeltz » Thu Aug 28, 2014 7:30 am

Again, since OpenCart is inviting new feature suggestion, I suggested supporting proper plurals for all languages. If you feel this is import, please vote.

Do, or do not. There is no try.


User avatar
Newbie

Posts

Joined
Thu Dec 06, 2012 10:46 pm
Who is online

Users browsing this forum: No registered users and 3 guests