[Catalyst] I18N with quotation marks

2009-07-01 Thread Ton Voon
Hi! I wanted to find out how other people are handling this problem. I am localising our app, which consists of strings in html and in dynamic javascript snippets. However, if the translated value contains quotations (such as: s'il vous plait), then it could break the HTML: or the javasc

Re: [Catalyst] I18N with quotation marks

2009-07-01 Thread Bill Moseley
On Wed, Jul 1, 2009 at 10:22 AM, Ton Voon wrote: > Hi! > > I wanted to find out how other people are handling this problem. > > I am localising our app, which consists of strings in html and in dynamic > javascript snippets. However, if the translated value contains quotations > (such as: s'il vo

Re: [Catalyst] I18N with quotation marks

2009-07-01 Thread Christian Lackas
* Bill Moseley [090701 19:58]: Hi Ton, > On Wed, Jul 1, 2009 at 10:22 AM, Ton Voon wrote: > > I am localising our app, which consists of strings in html and in dynamic > > javascript snippets. However, if the translated value contains quotations > > (such as: s'il vous plait), then it could bre

Re: [Catalyst] I18N with quotation marks

2009-07-01 Thread Larry Leszczynski
Hi Ton - > However, if the translated value contains quotations (such as: s'il > vous plait), then it could break the HTML: > > > > or the javascript: > > alert('[% c.loc("Please select one") %]'); We create some custom scalar ops in a subclass of Catalyst::View::TT (code below) that let you do:

Re: [Catalyst] I18N with quotation marks

2009-07-01 Thread Larry Leszczynski
> We create some custom scalar ops in a subclass of Catalyst::View::TT > (code below) that let you do: > > Actually, escape_dq won't work here: but it will work if for some reason you have a double-quote delimited JavaScript string. Will probably need to convert the double quotes to %22

Re: [Catalyst] I18N with quotation marks

2009-07-02 Thread Ton Voon
On 1 Jul 2009, at 18:22, Ton Voon wrote: I am localising our app, which consists of strings in html and in dynamic javascript snippets. However, if the translated value contains quotations (such as: s'il vous plait), then it could break the HTML: or the javascript: alert('[% c.loc("Pl

Re: [Catalyst] I18N with quotation marks

2009-07-03 Thread Jose Luis Martinez
Ton Voon escribió: For javascript in blocks, you should use single quotes for the string value and pass through an escape_js filter, eg: