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

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 ?
Reply
#2

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
Reply
#3

So i need to change all my system ?
Reply
#4

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
Reply
#5

http://avenir.ro/free-content-ads/
 here is nice tutorial about how to build Multilanguage app in Codeignter
Reply




Theme © iAndrew 2016 - Forum software by © MyBB