View Issue Details

IDProjectCategoryView StatusLast Update
0019211phpList 3 applicationInternationalization (l18n)public23-05-18 17:21
Reporterveltsu 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.3.1 
Target Version3.3.4Fixed in Version3.3.3 
Summary0019211: A couple of alert messages in index.php do not support translation
DescriptionThis is the code with my fixes:

  if (! compareEmail()) {
    //alert("Email addresses you entered do not match");
    alert ("' .$GLOBALS['strEmailsNoMatch'].'");

    return false;
  }';
    }

    $html .= '
  if (! checkEmail()) {
    //alert("Email addresses you entered is not valid");
    alert ("' .$GLOBALS['strEmailNotValid'].'");
    return false;
  }';
TagsNo tags attached.

Activities

veltsu

05-05-18 11:49

reporter   ~0060522

Same thing in 3.3.2

veltsu

20-05-18 14:18

reporter   ~0060613

Same bug in 3.3.3.

michiel

20-05-18 19:33

manager   ~0060614

The solution suggested is not going to be sufficient. When translating, you need to allow for unexpected characters. For example in French and Italian, they use a lot of apostrophes.

If the translation includes a single quote the page will break and nothing will work.

veltsu

20-05-18 20:05

reporter   ~0060615

Your are right. There some examples in index.php using str_replace.

May be these will work.

alert("' .str_replace('"', '\"', $GLOBALS['strEmailsNoMatch']).'");
alert("' .str_replace('"', '\"', $GLOBALS['strEmailNotValid']).'");

I never knew that dot notation can be used to concat strings in Javascript.

veltsu

20-05-18 20:23

reporter   ~0060616

Sorry, I must be tired. It's, of course, PHP.

michiel

20-05-18 20:39

manager   ~0060617

lol

Yes, @Xheni, something like that will probably work

veltsu

21-05-18 07:02

reporter   ~0060618

Thanks @michiel.
The code would be much cleaner, if the translated texts contain the escaping of special characters.

xheni

23-05-18 14:12

administrator   ~0060630

https://github.com/phpList/phplist3/pull/326