CodeIgniter Forums
Configuring Multi-Language Support - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Configuring Multi-Language Support (/showthread.php?tid=64129)



Configuring Multi-Language Support - mertdogan - 01-18-2016

I want to build multi-language site.

My config/config.php file has:
$config['language'] = 'turkish';
setting.

My config/autoload.php file has:
$autoload['helper'] = array('url','form','cookie','security','language');
and
$autoload['language'] = array('turkish','english');

Now; what my i do for language switch base on user language selection? What is the best method?


RE: Configuring Multi-Language Support - arma7x - 01-18-2016

I done it by store user preferences Lang in cookies. But some system Lang(form validation etc....) doesn't change, it follow default Lang in config.


RE: Configuring Multi-Language Support - mertdogan - 01-18-2016

(01-18-2016, 02:22 PM)arma7x Wrote: I done it by store user preferences Lang in cookies. But some system Lang(form validation etc....) doesn't change, it follow default Lang in config.

Ok but how do you switch beteen languages?


RE: Configuring Multi-Language Support - arma7x - 01-18-2016

Using dropdown inputbox in every pages. On change it will refresh & change page Lang. All code I put in MY_controller where I process to store and retrieve Lang from cookie.


RE: Configuring Multi-Language Support - mertdogan - 01-18-2016

(01-18-2016, 02:36 PM)arma7x Wrote: Using dropdown inputbox in every pages. On change it will refresh & change page Lang. All code I put in MY_controller where I process to store and retrieve Lang from cookie.

It is ok but how will you switch to current language _lang file with code?


RE: Configuring Multi-Language Support - orionstar - 01-18-2016

(01-18-2016, 02:42 PM)mertdogan Wrote:
(01-18-2016, 02:36 PM)arma7x Wrote: Using dropdown inputbox in every pages. On change it will refresh & change page Lang. All code I put in MY_controller where I process to store and retrieve Lang from cookie.

It is ok but how will you switch to current language _lang file with code?

http://www.codeigniter.com/user_guide/libraries/language.html#example-of-switching-languages


RE: Configuring Multi-Language Support - arma7x - 01-18-2016

All my application Lang I store in one file called application_lang.php.
$this->lang->load('application','english');. If you load more than one Lang then pass an array for 1st args. However only the custom Lang I translated did change, the other aren't


RE: Configuring Multi-Language Support - mertdogan - 01-18-2016

(01-18-2016, 02:50 PM)arma7x Wrote: All my application Lang I store in one file called application_lang.php.
$this->lang->load('application','english');. If you load more than one Lang then pass an array for 1st args. However only the custom Lang I translated did change, the other aren't

Ok man thank you but i know this way. I want to learn how can i load language files with
$this->lang->load('application','english');
setting of autoload.php config file.


RE: Configuring Multi-Language Support - Bhavesh - 01-18-2016

(01-18-2016, 01:35 PM)mertdogan Wrote: I want to build multi-language site.

My config/config.php file has:
$config['language'] = 'turkish';
setting.

My config/autoload.php file has:
$autoload['helper'] = array('url','form','cookie','security','language');
and
$autoload['language'] = array('turkish','english');

Now; what my i do for language switch base on user language selection? What is the best method?

Hi

Please read this article may be helpful.
http://www.codexworld.com/multi-language-implementation-in-codeigniter/


RE: Configuring Multi-Language Support - mertdogan - 01-19-2016

(01-18-2016, 09:38 PM)Bhavesh Wrote:
(01-18-2016, 01:35 PM)mertdogan Wrote: I want to build multi-language site.

My config/config.php file has:
$config['language'] = 'turkish';
setting.

My config/autoload.php file has:
$autoload['helper'] = array('url','form','cookie','security','language');
and
$autoload['language'] = array('turkish','english');

Now; what my i do for language switch base on user language selection? What is the best method?

Hi

Please read this article may be helpful.
http://www.codexworld.com/multi-language-implementation-in-codeigniter/

Thank you. Bu i read this document before and i know this technique. Bu there isn't any information about autoload feature of config file