On Wed, Oct 7, 2009 at 12:35 PM, Steven Roussey <[email protected]> wrote:
>
>> {my_var|Trans|html} # Translated and then apply HTML escaping
>
> Yes, trivial example is easily taken care of there. How about this
> trivial example:
>
> Hello {name}.
>
> Where the Hello needs translation?
How do other template languages handle this? I don't have much
experience in this area.
> Actually, in some languages who thing needs some translation because
> the name may come before Hello. Forcing every translation into the
> JSON isn't very nice to the template writer. If you overdo that, you
> end up with
>
> {html}
>
> as the whole template! <wink>
No, it may devoid of text, but it will still have a lot of structure
and markup. The way I see it there are 2 strategies:
1. English is primary and everything is translated from it
2. Make all languages equal by having a JSON strings file for each
AFAIK people tend to do #1, for the simple reason that most apps start
out without i18n. #2 is easily supported though.
At runtime you just do:
template.expand(Merge(static_strings + dynamic_data))
>> I think if i18n can be done without adding any concepts to the
>> language, that would be awesome, and it looks like it can.
>
> I don't think so, but it's just a decision to make on whether json-
> template wants to do it or not
Well if there is a proposal for a mechanism I can say what I think...
I'm not sure what exactly Django is doing.
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JSON
Template" 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/json-template?hl=en
-~----------~----~----~----~------~----~------~--~---