Multilingual files through sessions |
[eluser]alrightythen[/eluser]
Hi I'm building a multilingual site using cookies to retrieve language preferences, the cookies aren't the problem. I have added a folder in the system/language folder called dutch in wich I've added dutch language files from the codeigniter wiki. Also I've created 2 files both called 'site_lang.php' and put one in 'english' folder and one in 'dutch'. my controller looks like this... Code: class Home extends Controller { But this doesn't work. Does anyone have a better way to use multilingual sites? I've looked at the wiki of MY_language but that code is just too complicated for me.
[eluser]n0xie[/eluser]
Have you tried using url based internationalization? Take a look here: codeigniter i18n
[eluser]alrightythen[/eluser]
[quote author="n0xie" date="1260567664"]Have you tried using url based internationalization? Take a look here: codeigniter i18n[/quote] I would prefer working with sessions because it'll make my urls look.. well.. prettier.
[eluser]n0xie[/eluser]
Well for SEO reasons, unique internationalized url's are better but sessions should work fine too. Which part of your code is not working as I don't see anything particularly wrong with it...
[eluser]alrightythen[/eluser]
well the language should be set to session variable wich it does. So the load is Code: $this->lang->load('site', 'english'); But the language file called it dutch (the default). nothing wrong with my view either I'm just testing so there's only one line there Code: echo $this->lang->line('Sweet'); Also I will use a country specific domain name (www.example.nl or .be) so SEO will have some sort of language keys. |
Welcome Guest, Not a member yet? Register Sign In |