Welcome Guest, Not a member yet? Register   Sign In
Configuring Multi-Language Support
#1

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?
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes  Blush ).

If i write something by mistake; please don't distress it and try to understand what i want to write.
Reply
#2

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.
Keep calm.
Reply
#3

(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?
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes  Blush ).

If i write something by mistake; please don't distress it and try to understand what i want to write.
Reply
#4

(This post was last modified: 01-18-2016, 02:36 PM by arma7x.)

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.
Keep calm.
Reply
#5

(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?
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes  Blush ).

If i write something by mistake; please don't distress it and try to understand what i want to write.
Reply
#6

(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/li...-languages
Reply
#7

(This post was last modified: 01-18-2016, 02:53 PM by arma7x.)

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
Keep calm.
Reply
#8

(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.
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes  Blush ).

If i write something by mistake; please don't distress it and try to understand what i want to write.
Reply
#9

(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...deigniter/
Reply
#10

(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...deigniter/

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
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes  Blush ).

If i write something by mistake; please don't distress it and try to understand what i want to write.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB