
ton.voon at opsera
Jul 1, 2009, 10:22 AM
Views: 877
Permalink
|
|
I18N with quotation marks
|
|
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: <select value='[% c.loc("Please select one") %]'> or the javascript: alert('[% c.loc("Please select one") %]'); We also sometimes use double quotes for attributes instead of single quotes. What is the best practise? Always run c.loc() through a filter to convert to HTML entities? (Although in FF3.0 alert('Impossible d'exécuter snmpget pour tester la connexion'); does not give the single quote). I was considering creating methods of c.hloc() (for a html environment) and c.jloc() (for a javascript environment), but then the xgettext.pl helper does not look for these method names. Ton _______________________________________________ List: Catalyst[at]lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
|