| Author |
Message |
|
gob33
|
Post subject: Single quotes in translation files Posted: Thu Jun 24, 2010 9:06 am |
|
Joined: Thu Jun 24, 2010 8:57 am Posts: 3 Location: France
|
|
I would like to put here a warning for translators. If you use single quote in your translation, this can lead you to some miss-functionning. That comes from the fact some portions of the code mix javascript and php.
Suppose you have a php constant with single quote normally escaped: define (MY_CONSTANT, 'prix d\'achat'); And this constant is used by javascript code: my_variable = '<?php echo MY_CONSTANT ?>'; This lead to pbs as the closing quote is not the desired one on the javascript line: my_variable = 'prix d'achat';
So avoid using single quote.
Last edited by gob33 on Sat Jun 26, 2010 10:27 am, edited 2 times in total.
|
|
 |
|
 |
|
dave
|
Post subject: Re: Single quotes in translation files Posted: Fri Jun 25, 2010 12:28 pm |
|
Joined: Fri Oct 26, 2007 3:55 pm Posts: 3499 Location: Colorado, US
|
|
This is a good observation. I have R2.1 about ready to go but I will put this on the bug list for the next release. I have a js_encode function that will handle this but it's not used everyplace it should be. Thanks for the post.
Dave
|
|
 |
|
 |
|
gob33
|
Post subject: Re: Single quotes in translation files Posted: Fri Jun 25, 2010 4:58 pm |
|
Joined: Thu Jun 24, 2010 8:57 am Posts: 3 Location: France
|
|
Its practical observation from tentative to translate. But it's really a pain. Financials terms search for equivalents, chart of accounts different, taxes not federal, many many (big) files, all that get me mad and i dont see the end.
For the quote, I use html special char ' everywhere for the moment.
|
|
 |
|
 |
|