Jump to content


Validation message language


  • Please log in to reply
4 replies to this topic

#1 nunenthal

nunenthal

    Member

  • Members
  • PipPip
  • 27 posts
  • LocationFrance

Posted 13 May 2019 - 04:10 PM

Hello,

 

How to set the language for the valitron library.

 

Thank you.

 

I use

$crud->setLanguage('French');

 

But don't work.

 

Thank you.

 



#2 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,096 posts
  • LocationLondon

Posted 17 June 2019 - 08:21 AM

Hello,

 

How to set the language for the valitron library.

 

Thank you.

 

I use

$crud->setLanguage('French');

 

But don't work.

 

Thank you.

 

Hello @nunenthal,

 

Currently this is not working "out of the box" as the mapping is a bit different. I will try to see if I can do something automatically at the future to pick it up automatically. Till then you can use the below work-around: 

Add the below line anywhere before the render() :

 

\Valitron\Validator::lang('fr');

This will enable the language for "French" for Valitron

 

I will try to have this to work out of the box in the future so you will not have to do it manually this step. 

 

Let me know if that worked for you

 

Regards

Johnny


Posted Image

#3 nunenthal

nunenthal

    Member

  • Members
  • PipPip
  • 27 posts
  • LocationFrance

Posted 17 June 2019 - 04:10 PM

Perfect, this work for me, added in the construct  function like this, so it's just one time for all my administration function, no worry

 

 

public function __construct()
    {
        parent::__construct();
                \Valitron\Validator::lang('fr');
        $this->load->database();
        $this->load->helper('url');
                $this->load->library('session');
                $this->load->helper('form');
                $this->load->model('login_m');
      
        include(APPPATH . 'config/config.php');
               }

       
 



#4 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,096 posts
  • LocationLondon

Posted 18 June 2019 - 02:18 PM

Perfect, this work for me, added in the construct  function like this, so it's just one time for all my administration function, no worry

 

 

public function __construct()
    {
        parent::__construct();
                \Valitron\Validator::lang('fr');
        $this->load->database();
        $this->load->helper('url');
                $this->load->library('session');
                $this->load->helper('form');
                $this->load->model('login_m');
      
        include(APPPATH . 'config/config.php');
               }

       
 

 

I am glad that this worked for you :)

In case you are interested, I've scheduled to have a permanent fix for the next release. It will probably pick up the language automatically from setLanguage. If you would like to track the progress of this task you can go to: https://trello.com/c...e-automatically and press the button "Follow"

 

Regards

Johnny


Posted Image

#5 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,096 posts
  • LocationLondon

Posted 22 June 2019 - 06:16 AM

I am glad to inform you that at the new version of Grocery CRUD Enterprise (2.7.6) this extra step is not required anymore as it happens automatically.

 

In case you would like to download the latest version visit: https://www.groceryc..._latest_version

 

Regards

Johnny


Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users