Form_validation and lang: while comparing two fields |
[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.
[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?
[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.
[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?
[eluser]skunkbad[/eluser]
I have never seen lang: in the docs. Where does this usage come from?
[eluser]Pascal Kriete[/eluser]
It's documented under translating field names. Been there since the new form validation library was added .
[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/
[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. |
Welcome Guest, Not a member yet? Register Sign In |