Welcome Guest, Not a member yet? Register   Sign In
Need help with language helper

Can you help me ?
I cannot switch my language into my view.

Here is my config.php

$autoload['helper'] = array('url', 'file', 'language');
$autoload['language'] = array('homepage');

My view is on php like that : <?= lang('carousel_title'); ?>

My controller : public function index($language = 'french')

And here is my routes :

// Routes française
$route['fr'] = 'Page/index';

// Route Anglaise
$route['en'] = 'Page/index/english';

My problem, is for every url, i'm in french. /en didn't work. How set the default language for an user in my controller ?

Personally I'm using a language loader so that I don't need to specify it in every url.

So i need to change all my system ?

You don't have too, but in case you need us to help you debug your system you need to supply a lot of more code. The best option is to make a small demo with just your language code and upload it somewhere.

What's in your language helper?
You controller specifies french and not fr, so will /english work? (In case your route are broken)
What does it do with $langauge after you have supplied it?
Do you have multiple controllers or just one?

 here is nice tutorial about how to build Multilanguage app in Codeignter

Theme © iAndrew 2016 - Forum software by © MyBB