Javascript errors with French language.... Javascript errors with French language....
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Javascript errors with French language....

Started by etienne, December 30, 2003, 08:39:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

etienne

In French translations, there are some quotes.
When these translations are used in javascripts, this leads to errors.
For example, in albmgr.php we have the following javascript:
alert('Vous n'avez effectué aucun changement !').

Probably the solution is to enclose the string parameter between double-quotes... (assuming there is no double-quote within translations!).

Joachim Müller

no, the solution is to escape the single quotes like this
Quotealert('Vous n\'avez effectué aucun changement !')
(with a backslash in front of it).
Could you go through french.php and fix the errors that occur? I'll send you a pm with my email address, I'd appreciate you sending me the corrected version.

GauGau

etienne

Gaugau,

in fact the quotes are already escaped...
what needs to be change is the way the alert is coded.
alert('<?php echo $lang_albmgr_php['no_change'&#93; ?>');
always generates  alert('Vous n'avez effectué aucun changement !') that is wrong

On my site I've changed it to:
alert("<?php echo $lang_albmgr_php['no_change'&#93; ?>");

and it now works!

Titooy

Actually that was solved some months ago... it's strange that these solutions didn't take place in the new release...

http://forum.coppermine-gallery.net/viewtopic.php?p=2948#2948

A corrected french translation was even provided by Rodinou...

It seems that the 1.2.1 was based on an ancient one :?

Joachim Müller

things like that can happen, with a lots of people sending in translation files where they change the bits they're concerned about.
Please forgive this oversight...
To use a string with a single quote inside JavaScript PopUps they have to be escaped two times, making it a total of three backslashes, like this
Quote'Vous n\\\'avez effectué aucun changement !'
I'm sure I've already explained this on the thread dealing with translations.

GauGau

binocle

I use coppermine1.1 for more than 6 month I've try the 1.2 version.
When I try to create album, when using the french language, no album is creates.
When I try to create albums, when using the english language, i've got no problem.
I don't understant what happen  :?

Titooy

The problem has already been discuted but was not yet solved in the distribution.

Here is my corrected version
http://titooy.free.fr/coppermine_lang_french.zip

Joachim Müller

merged the last two postings before mine to this thread (were originally posted as different thread). I've uploaded the proposed fixes of Titooy to the download section (minus some additions that are not in the standard distribution), get it here: cpg1.2.1lang_french.zip - they will go into the next release as well. Thanks for the contribution...

GauGau

chtito

There is an error in the date formats in the French translation.

Here are the right formats:


// The various date formats
// See http://www.php.net/manual/en/function.strftime.php to define the variable below
$album_date_fmt =    '%e %B %Y';
$lastcom_date_fmt =  '%d/%m/%y à %H:%M';
$lastup_date_fmt = '%e %B %Y';
$register_date_fmt = '%e %B %Y';
$lasthit_date_fmt = '%e %B %Y à %H:%M';
$comment_date_fmt =  '%e %B %Y à %H:%M';


cheers
Vous pouvez poser vos questions en français sur le forum francophone !