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
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
* 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
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:
> 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
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
Ton Voon escribió:
For javascript in blocks, you should use single quotes for the
string value and pass through an escape_js filter, eg: