CodeIgniter Forums

Full Version: Need help with language helper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
https://forum.codeigniter.com/thread-716...#pid357488
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.

E.g.
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?
etc
http://avenir.ro/free-content-ads/
 here is nice tutorial about how to build Multilanguage app in Codeignter