• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$this->validation->set_message simple issue


The app I'm coding is not in English, so I'm trying to do the following:

// username
$rules['username'] = "required";
$this->validation->set_message($rules['username'], 'username is a required field in my language');

// password
$rules['password'] = "required";
$this->validation->set_message($rules['password'], 'password is a required field in my language');

The problem is I'm getting "password is a required field in my language" for both fields Sad

For instance, I just can't write:

- Username est un champ obligatoire (in french), it should be something like:

- Le nom d'utilisateur est un champ obligatoire

How can I overcome this problem?

Your help would be greatly appreciated.

Why not set the default language to french, that is the easiest solution. There is a french languagepack available on the wiki.

How can I get "Le nom d’utilisateur est un champ obligatoire" instead of "Username est un champ obligatoire" in doing that?

Then you have to use the set_fields method
$fields['username'] = "le nom d'utilisateur";

Thank you very much that worked perfectly. I knew there was a clever solution for this Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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