Strange behaviour during translations

Post modules, themes or any other code you want to share with the community.

Moderator: Developers

Strange behaviour during translations

Postby Jordi Sanfeliu » Mon Feb 06, 2006 4:04 pm

Hi,

I'm ready to send the Spanish and Catalan translations to the mail that appears in the Development Guide (translations@intermesh.nl), but before do that I want to share a very strange behaviour in two variable definitions in one ca.inc file (for the Catalan language).

$ml_loose_changes and $ml_please_close_attachments seems does not even accept escape the single quote like this:

"aaaa bbbb\'bb ccc";

At this moment the only workaround has been to rethink the phrase to try to not include a single quote. :-/

Can you confirm that situation before I send the language packages?
Jordi Sanfeliu
 
Posts: 11
Joined: Wed Jan 25, 2006 3:34 pm

Postby Intermesh » Mon Feb 06, 2006 4:09 pm

If the string is encapsulated by 2 double qoutes then you shouldn't escape the single quotes. Two examples:

"It wasn't me"
'It wasn\'t me'

Both should work fine. I prefer you use the second style.
Best regards,

Merijn Schering
Intermesh
User avatar
Intermesh
Site Admin
 
Posts: 7085
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch

Postby Jordi Sanfeliu » Mon Feb 06, 2006 4:14 pm

I noticed that, my example is incorrect, the string is encapsulated by 2 single quotes like this:

'It wasn\'t me'

If I simply remove the escaped single quote and leave the string like:

'It wasnt me'

it works!!

Where is the problem?

PS: The complete file path is:
/modules/email/language/ca.inc
Jordi Sanfeliu
 
Posts: 11
Joined: Wed Jan 25, 2006 3:34 pm

Postby Intermesh » Mon Feb 06, 2006 4:24 pm

Is the file encoded in UTF-8 encoding?
Best regards,

Merijn Schering
Intermesh
User avatar
Intermesh
Site Admin
 
Posts: 7085
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch

Postby Jordi Sanfeliu » Mon Feb 06, 2006 4:34 pm

Every time I started a file translations it has been copied from the original english version "en.inc", and VIM does not notify any conversion, and even the option "fileenconding" is set to utf-8.

Can you see in the code if those two variable have a special treatment that can generate some bug?
Jordi Sanfeliu
 
Posts: 11
Joined: Wed Jan 25, 2006 3:34 pm

Postby Jordi Sanfeliu » Mon Feb 06, 2006 5:20 pm

TIP!

Lot of other strings in the same ca.inc file and others have a single quote in and does not create any problem.

How I have discovered this strange behaviour?

If the two above mentioned variables contains a single quote in, the button called "Attachments" that appears in the window when you are creating a new email does not open any browsing dialog window.

On the other hand, if you removes the single quote from the mentioned strings, the button opens the expected brower dialog window.

:-/
Jordi Sanfeliu
 
Posts: 11
Joined: Wed Jan 25, 2006 3:34 pm

Postby Intermesh » Tue Feb 07, 2006 7:34 am

I forgot to encode the strings for the javascript functions. Please look up the values in modules/email/compose.inc and change them to:

htmlspecialchars(addslashes($ml_please_close_attachments))
htmlspecialchars(addslashes($ml_loose_changes))
Best regards,

Merijn Schering
Intermesh
User avatar
Intermesh
Site Admin
 
Posts: 7085
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch

Postby Jordi Sanfeliu » Tue Feb 07, 2006 7:47 am

Ok, all is fixed now. Case closed ;-)

Right now I will send the two translation packages (Spanish and Catalan).

Thanks for your support.
Jordi Sanfeliu
 
Posts: 11
Joined: Wed Jan 25, 2006 3:34 pm


Return to Contributed development

Who is online

Users browsing this forum: No registered users and 0 guests