Welcome Guest, Not a member yet? Register   Sign In
form_validation_lang.php not loading in the proper language
#1

[eluser]stef25[/eluser]
I have a site in FR and NL languages. When a form is submitted in FR and there are errors, the correct messages are shown, those from the form_validation_lang.php in language/fr

But when the site is in NL and the form is submitted with errors I get a message like this

Code:
Le champ Voornaam est obligatoire.

Where "Voornaam" is the correct NL translation but the other words are the FR ones.

Another issue is that when password and password confirmation fields must match, I get an error that says:

Code:
Le champ Paswoord: n'est pas égale au champ lang:pass_conf.

Where "Paswoord" is the correct NL word but the rest is in FR and obviously it should not mention lang:pass_conf but the actual NL label.

The validation rules are set in an external file as such:

Code:
array(
                                            'field' => 'password',
                                            'label' => 'lang:password',
                                            'rules' => 'trim|required|min_length[5]|matches[pass_conf]'
                                         ),
                                   array(
                                            'field' => 'pass_conf',
                                            'label' => 'lang:pass_conf',
                                            'rules' => 'trim|required'
                                         ),

Obviously in language/nl/form_validation_lang.php contains the correct translation, but the message shown is the one from language/fr/form_validation_lang.php

Code:
$lang['required']             = "Het veld %s is verplicht.";

Other than that, everything on the site is correctly translated. Can anyone tell me where I'm going wrong?
#2

[eluser]tomcode[/eluser]
Sounds like Your loading the form validation language before switching the language




Theme © iAndrew 2016 - Forum software by © MyBB