Topic: wrong order of the error messages (Read 1626 times)
Total Zero
Gender:
Posts: 5
38 credits Members referred : 0
« on: Jun 08, 2006, 10:27:11 pm »
i've translated the msg's to polish (thx olaf for appreciate it) and if I set the language to pl the error mesages are in wrong order - the $msg[0] = "Please correct the following error(s):"; is at the end, what can it be? maybe somebaody have the same problem?
« Last Edit: Jun 08, 2006, 11:12:19 pm by olaf »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
Re: showing the error messages
« Reply #1 on: Jun 08, 2006, 10:34:05 pm »
what is the code you are using together with the form?
Please show us only the php part and do you tried the original example? is there a live version?
EDIT I think I found the problem:
Code:
<?php function create_msg($break_elem = "<br />") { $the_msg = ""; krsort($this->messages); // new in 1.35 reset($this->messages); foreach ($this->messages as $value) { $the_msg .= $value.$break_elem."\n"; } return $the_msg; }
It looks like that asort isn't the right function
about your translations, this text is OK together with iso-8859-2 encoding, is there a possebility to have them working for utf-8 (will say all polish special characters with unicode values)? After the sesond polish website I learned that utf-8 is the best way to handle this characters.
« Last Edit: Jun 08, 2006, 10:53:11 pm by olaf »
Total Zero
Gender:
Posts: 5
38 credits Members referred : 0
« Reply #2 on: Jun 08, 2006, 11:09:53 pm »
Code:
include("includes/class/validation_class.php"); $example = new Validate_fields; $example->check_4html = true;
$example->add_link_field("Kontakt_::_E-mail", $email, "email"); $example->add_link_field("Kontakt_::_Strona WWW", $_POST['www'], "url", "n"); if ($example->validation()) { $this->output.= "<center><br />Dane poprawne!<br />Profil został zapisany.</center>"; // replace this text if you like... } else { $this->output.= $example->create_msg(); }
the code is somehting like that
about the translaton i wil look for it
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #3 on: Jun 08, 2006, 11:11:27 pm »
It have to work if you modify this row:
krsort($this->messages); // new in 1.35
check the new version on my site there is also some other new functionallity...
Total Zero
Gender:
Posts: 5
38 credits Members referred : 0
« Reply #4 on: Jun 08, 2006, 11:17:42 pm »
with the new wersion it works perfectly. Thanks!
the utf-8
Code:
case "pl": $msg[0] = "Wystąpiły następujące błędy w formularzu:"; $msg[1] = "Pole <b>".$fieldname."</b> jest puste."; $msg[10] = "Data w polu <b>".$fieldname."</b> nie jest poprawna."; $msg[11] = "Adres e-mail w polu <b>".$fieldname."</b> nie jest poprawny."; $msg[12] = "Wartość w polu <b>".$fieldname."</b> nie jest poprawna."; $msg[13] = "Text w polu <b>".$fieldname."</b> jest za długi."; $msg[14] = "Adres strony w polu <b>".$fieldname."</b> nie jest poprawny."; $msg[15] = "W polu <b>".$fieldname."</b> znaleziono kod HTML, nie jest to dozwolone."; break;
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #5 on: Jun 08, 2006, 11:22:45 pm »
thank you for the translations...
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2797