Welcome Guest, Not a member yet? Register   Sign In
Change language
#11

[eluser]GeXus[/eluser]
Even if I do just this though in my controller

Code:
$this->config->set_item('language','german');
echo $this->config->item('language');

It doesn't echo german, it should right?
#12

[eluser]LuckyFella73[/eluser]
Yes it should. Very strange - no idea what's going wrong then ..
#13

[eluser]Jaketoolson[/eluser]
I had a similar problem -- I was autoloading my config file which would reset everything back to default even after using set.

http://ellislab.com/forums/viewreply/863884/
#14

[eluser]GeXus[/eluser]
How do you not auto load your config? It's not set in the autoload.php, I think the config.php always auto loads?

I commented out this line
Code:
$config['language']    = 'english';

In my config and now setting it within my controller, but it still doesn't set it.
#15

[eluser]GeXus[/eluser]
I am auto loading the language file 'static'.

I have the following file structure:

/language/english/static_lang.php
/language/german/static_lang.php

Then I'm auto loading 'static' as the language file. If I don't auto load this and try to do it using:

Code:
$this->ci->config->set_item('language', 'english');
$this->ci->lang->load('static', 'english');

It doesn't work, even when I comment out the language setting in the config.
#16

[eluser]Jaketoolson[/eluser]
Why don't you echo out the config language item out in your config file.
Then echo it out again before you set_item. Then set the item. Then echo it out again.

Just trying to figure out where it's changing (or not changing), that's all.
#17

[eluser]GeXus[/eluser]
Ok, actually it seems to be setting it - however it's not loading the german language (which exists), it's still showing english.

Code:
echo $this->config->item('language');
//prints: english

$this->config->set_item('language', 'german');
echo $this->config->item('language');
//prints: german
#18

[eluser]GeXus[/eluser]
It's working!

I had to remove the autoload of the 'static' file. Have to just load the files as-needed. Thanks for all your help
#19

[eluser]Jaketoolson[/eluser]
assuming you've created a German language file, what are you using to reference the language file? Where where you would output text to the browser, do you use something like:
Code:
echo lang('my name is:');

// outputs
"Ich Heisse "
#20

[eluser]CodeIgniterNewbie[/eluser]
Hi GeXus, I think I may be having a similar problem as you did. What do you mean by "'static' file?"

My autoload.php is not autoloading any language files. My config.php still has the default "english" in it.

[quote author="GeXus" date="1307133412"]It's working!

I had to remove the autoload of the 'static' file. Have to just load the files as-needed. Thanks for all your help[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB