On Fri, 2009-03-06 at 19:13 -0200, Ramiro Morales wrote: [...] > I'd say this usage of blocktrans is intrinsically broken, independent of > which strategy gets used to solve the problem and, because of this, a > bug worth fixing now.
Firstly, good analysis of the problem, since (as can be seen by my response on django-users), I couldn't immediately see why this wasn't working. I agree with your conclusion. The "blocktrans" tag is simply being used inappropriately here. It's a good tag for translating essentially static template content. What it doesn't do it look inside the variables it substitutes, so is appropriate where the translation works regardless of the variable content. It appears particularly severe in this case because the blocktrans section *only* includes a variable replacement. This is the old problem that you can't build up truly translatable sentences from pieces, so if parts of the sentence has replaceable parts, they are restricted to being things that can be replaced everywhere. In this case, the "trans" tag is the right solution, since it does the translation based on the variable's value: that is, resolves the variable first and then looks up that string in the message catalog. > I am willing to open a ticket with a simple patch (that would > essentially just implement the template modifications enumerated > [5]here) to fix this but wanted to get opinions from people with more > experience in this domain. Yes, I think the ideas posted in the summary in that thread are the correct solution. I've got your revisions to the i18/l10n documentation in my pile to review this weekend, so I'll also have a look at explaining blocktrans vs. trans usage a bit more clearly. The fact that I entirely missed why this was failing has me worried. I know I have my bad days, but I'm not entirely a novice in this area and until you laid out what's going on, it was confusing (now it's blindingly obvious). We need to document that better, for sure! :-) Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django I18N" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Django-I18N?hl=en -~----------~----~----~----~------~----~------~--~---
