matthiask / plata

Plata - the lean and mean Django-based Shop
https://plata-django-shop.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
197 stars 63 forks source link

Issue 29 #32

Closed hkage closed 11 years ago

hkage commented 11 years ago

Fixes issues 29 (plata.shop.models translations). I also added a small unittest, that will check these three modified __unicode__ methods.

arteme commented 11 years ago

This is tricky. Changing "%s of %s" % (x, y) to "%s %s %s" % (x, _("of"), y) only works for languages that have the "of" preposition and its position is the same. This will not work, for example, in Russian or Finnish languages. Could I suggest that the translation in this case be something of sorts of _("{1} of {2}").format(x, y)? That would make it possible to translate (or at least approximate) the __unicode__ for languages that don't indicate possession with a preposition but genitives and existential forms.

matthiask commented 11 years ago

Best practice at the moment is "%(bla)s of %(blub)s" % {'bla': ..., 'blub': ...} as far as I am concerned. @hkage can you modify the translation strings so that translation to languages with different order of words work too?

hkage commented 11 years ago

I didn't consider this case, thanks for reminding me. I will make the change as soon as possible.

matthiask commented 11 years ago

Thanks in advance!

hkage commented 11 years ago

As I see a second commit of mine has just beend added to this pull request (revision c5b4714). Is it possible to remove a changeset from a pull request? This change has nothing to do with issue 29 and was just a small typo fix.

matthiask commented 11 years ago

I don't think it's possible to remove commits from a pull request. You'd have to rebuild the branch and open a new request.

Btw, the mentioned change isn't correct. The order and the cart are the same object, the only difference is the status. Compare this to other shop software such as Satchmo and Django-Shop where a Cart is a separate entity from the Order.

Maybe the meaning becomes clearer when you read it as "This order is only a cart at the moment (but once the checkout process starts, it becomes an order)."

Does that clear things up?

hkage commented 11 years ago

You are right. 'Cart' is only a status of the order. I read the translation from the admin backend point of view and our QA stumbled upon the phrase also. From the technical point of view it is correct.

I will rebuild the branch and checkin only the changes concerning issue 29.