Bug 7433

Summary: french translation add a bad single quote into js function
Product: Koha Reporter: Stéphane Delaune <stephane.delaune>
Component: I18N/L10NAssignee: Stéphane Delaune <stephane.delaune>
Status: CLOSED INVALID QA Contact: Ian Walls <koha.sekjal>
Severity: minor    
Priority: PATCH-Sent (DO NOT USE) CC: chris, katrin.fischer
Version: 3.6   
Hardware: All   
OS: All   
URL: cgi-bin/koha/tools/stage-marc-import.pl
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: fix 7433

Description Stéphane Delaune 2012-01-10 14:00:47 UTC
in staff, the french version of cgi-bin/koha/tools/stage-marc-import.pl have this line into a javascript's function : 

alert(_('Echec de l'envoi du formulaire : ') + textStatus);

(original text : alert(_('Failed to submit form: ') + textStatus);)

the single quote isn't escaped
Comment 1 Stéphane Delaune 2012-01-10 14:17:33 UTC
Created attachment 7103 [details] [review]
fix 7433
Comment 2 Stéphane Delaune 2012-01-10 14:22:28 UTC
to test  : misc/translator$ ./translate install fr-FR
select fr-FR on language syspref
go to cgi-bin/koha/tools/stage-marc-import.pl
import a file (clic on "Télécharger fichier") and clic on "traiter pour import" if it works, it's ok
Comment 3 Chris Cormack 2012-01-13 06:53:14 UTC
Stephane, wouldn't another option be to fix the po file? So that the ' is escaped?

If that isn't a possibility then let me know and I can test and sign off on this.
Comment 4 Stéphane Delaune 2012-01-18 10:03:19 UTC
it is possible to escape the character but is more common to have a text containing ' rather than " so it seems more appropriate to apply this patch, rather than to escape the character '
Comment 5 Katrin Fischer 2012-01-18 10:23:58 UTC
I think it depends on the language. For example we don't use single quotes in German, but we would use "" for quoting of words.

Perhaps a solution would be to fix the translation scripts. So when they find an ' or " in a _javascript_ string, the characters are escaped.

Note: Translation of javascript is also problematic for concatenated strings (see bug 7327).