Welcome Guest, Not a member yet? Register   Sign In
Problems With Languages
#1

[eluser]CodeIgniterNewbie[/eluser]
I'm trying to make my site multi-lingual. I've created 2 folders and 2 files so far:
Code:
/application/language/en-us/
/application/language/en-us/application_lang.php
/application/language/fr-ca/
/application/language/fr-ca/application_lang.php
In the language files, I have the following declarations:
Code:
$lang['lang_company_name'] = 'Hello'; // en-us
$lang['lang_company_name'] = 'World'; // fr-ca
Then my test code:
Code:
$this->lang->load('application', 'en-us');
echo $this->lang->line('lang_company_name');
$this->lang->load('application', 'fr-ca');
echo $this->lang->line('lang_company_name');
The output is:
Code:
HelloHello
. Why am I not getting
Code:
HelloWorld
?

UPDATE:

autoload.php has nothing for $autoload['language']. config.php still has $config['language'] = 'english'.
#2

[eluser]Aken[/eluser]
Your example works fine for me. What version of CI are you using? Have you made sure that the language files are actually different, and your directory and file names are correct? You can also try enabling logging and seeing that both files are loaded properly (or check the results of $this->lang->load() also).
#3

[eluser]TonySpace.com[/eluser]
[quote author="Aken" date="1350017022"]Your example works fine for me. What version of CI are you using? Have you made sure that the language files are actually different, and your directory and file names are correct? You can also try enabling logging and seeing that both files are loaded properly (or check the results of $this->lang->load() also).[/quote]
Yes. Cool.




Theme © iAndrew 2016 - Forum software by © MyBB