Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users
I18N with quotation marks
 

Index | Next | Previous | View Flat


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&#39;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/

Subject User Time
I18N with quotation marks ton.voon at opsera Jul 1, 2009, 10:22 AM
    Re: I18N with quotation marks moseley at hank Jul 1, 2009, 10:55 AM
    Re: I18N with quotation marks christian at lackas Jul 1, 2009, 11:47 AM
    Re: I18N with quotation marks larryl at emailplus Jul 1, 2009, 11:51 AM
    Re: I18N with quotation marks larryl at emailplus Jul 1, 2009, 11:57 AM
    Re: I18N with quotation marks ton.voon at opsera Jul 2, 2009, 1:35 AM
        Re: I18N with quotation marks jlmartinez-lists-catalyst at capside Jul 3, 2009, 3:27 AM
        Re: I18N with quotation marks ton.voon at opsera Jul 8, 2009, 6:59 AM
    Re: I18N with quotation marks gunnarstrand at yahoo Jul 8, 2009, 8:28 AM
        Re: I18N with quotation marks cosimo at streppone Jul 8, 2009, 8:58 AM
    Re: I18N with quotation marks gunnarstrand at yahoo Jul 8, 2009, 10:32 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.