Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 2.1 internationalization i18n with memorise language in a Cookie
#1

[eluser]henry178[/eluser]
Hi all,
I'm using CodeIgniter 2.1 internationalization i18n (https://github.com/EllisLab/CodeIgniter/...ation-i18n).
I would like modify the code for save the selected language by the user in a cookie and open directly the traduction at the next visit.

How can I modify the class "MY_Lang"?
#2

[eluser]InsiteFX[/eluser]
1) Find where it's reading the user selected language into a variable, and save it in a cookie.

2) Read the users cookie and assign the language to the users language in the class.

If you are using a dropdown for language selection you can grab it from there.

Use a MY_Controller for setting the language when the user logs in.
#3

[eluser]henry178[/eluser]
Thanks, I found this code https://code.google.com/p/uastravel/sour...pec=svn146 but I can't understand where I might send the cookie that contain che language choosed (uk, de, fr ecc). Could you help me?
#4

[eluser]InsiteFX[/eluser]
For one this is using the older php constructor, but that is where you would read the cookie and set the language in.




Theme © iAndrew 2016 - Forum software by © MyBB