![]() |
Form_validation and lang: while comparing two fields - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Form_validation and lang: while comparing two fields (/showthread.php?tid=23357) |
Form_validation and lang: while comparing two fields - El Forum - 10-08-2009 [eluser]henlee[/eluser] Code: $this->form_validation->set_rules('password', 'lang:label_password', 'trim|required|min_length[5]|max_length[12]|sha1'); Above code outputs: Quote:The Password field does not match the lang:label_passconf field. Code: $this->form_validation->set_rules('password', $this->lang->line('label_password'), 'trim|required|min_length[5]|max_length[12]|sha1'); While the above code outputs: Quote:The Password field does not match the Password again field. Form_validation and lang: while comparing two fields - El Forum - 10-09-2009 [eluser]skunkbad[/eluser] I think it is working as documented. Consider your second code example. The value of $this->lang->line('label_passconf') is Password again. What were you expecting? Form_validation and lang: while comparing two fields - El Forum - 10-12-2009 [eluser]henlee[/eluser] When you look at the first output, Quote:The Password field does not match the lang:label_passconf field.you can see that the second label is not translated because I used lang:label_passconf in my form_validation. The first lang:label_password (Password) is correctly translated. When I use $this->lang->line in both instances is gets translated correctly. Form_validation and lang: while comparing two fields - El Forum - 10-12-2009 [eluser]Pascal Kriete[/eluser] Yeah, it's not translating the second field. Could you file a bug report with a link to this thread, please? Form_validation and lang: while comparing two fields - El Forum - 10-12-2009 [eluser]skunkbad[/eluser] I have never seen lang: in the docs. Where does this usage come from? Form_validation and lang: while comparing two fields - El Forum - 10-12-2009 [eluser]Pascal Kriete[/eluser] It's documented under translating field names. Been there since the new form validation library was added ![]() Form_validation and lang: while comparing two fields - El Forum - 10-12-2009 [eluser]skunkbad[/eluser] Learn something new every day. Form_validation and lang: while comparing two fields - El Forum - 10-13-2009 [eluser]henlee[/eluser] [quote author="Pascal Kriete" date="1255390310"]Yeah, it's not translating the second field. Could you file a bug report with a link to this thread, please?[/quote] Sure thing http://codeigniter.com/bug_tracker/bug/9132/ Form_validation and lang: while comparing two fields - El Forum - 10-13-2009 [eluser]skunkbad[/eluser] Well, I guess I am sort of jealous. You list a bug and it is fixed immediately. I put in the one right before you, and nada. I see a lot of bug reports are not ever dealt with. I hope mine is fixed, because I don't want to have to keep fixing it every time I make a website. |