Translations of view messages ?

12 views
Skip to first unread message

David Unric

unread,
Nov 8, 2012, 6:22:46 AM11/8/12
to satchm...@googlegroups.com
Hiya,

most of the Satchmo store returns properly translated content based on l10n settings, but some parts are only in English.

For example error message in cart view (product is out of stock) is not localised. The code returning an error message in view cart.py for cart template cart.html looks like

            if stock < qty:
                return (False, cart, cartitem, _("Unfortunately we only have %(stock)d '%(cartitem_name)s' in stock.") % {'stock': stock, 'cartitem_name': cartitem.product.translated_name()})

What do I have to do to get translated content in such cases ?
Do I have to hardcode localised text in my custom views or is there some more transparent way ?

Thanks

David

David Unric

unread,
Nov 8, 2012, 4:23:19 PM11/8/12
to satchm...@googlegroups.com
Hi,

so I have to answer my own question.
There was a problem with not-updated gettext's localisation file, slight difference in input message.
Placed copy in /store/locale/<langcode>/<langcode>.po and updated its contents, then compiled into appropriate .mo file.
Now I can fix all untranslated messages this way.
Reply all
Reply to author
Forward
0 new messages