Register    Login    Forum    Search    FAQ

Board index » Misc. » Localization




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Single quotes in translation files
 Post Posted: Thu Jun 24, 2010 9:06 am 
Offline

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.

Top 
 Profile  
 
 Post subject: Re: Single quotes in translation files
 Post Posted: Fri Jun 25, 2010 12:28 pm 
Offline

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


Top 
 Profile  
 
 Post subject: Re: Single quotes in translation files
 Post Posted: Fri Jun 25, 2010 4:58 pm 
Offline

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 &#39; everywhere for the moment.


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 3 posts ] 

Board index » Misc. » Localization


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: