• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
form_validation_lang.php not loading in the proper language

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

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:

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:

                                            'field' => 'password',
                                            'label' => 'lang:password',
                                            'rules' => 'trim|required|min_length[5]|matches[pass_conf]'
                                            '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

$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?

Sounds like Your loading the form validation language before switching the language

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.