Welcome Guest, Not a member yet? Register   Sign In
Language library bug
#1

[eluser]klezmer41[/eluser]
Using this method to change language files did not work (maybe because the files are named the same?):

$this->lang->load('main', 'eng');
$this->lang->load('main', 'fra');

This method did work:

$this->lang->load('eng_main', 'eng');
$this->lang->load('fra_main', 'fra');

Either one should work because the files existed in language/eng/ and language/fra/

Is this a bug?
#2

[eluser]xwero[/eluser]
In the CI language class you can't load two files with the same content because the second one will overwrite the other, in that view it's no bug.

Have a look at my take on the language library.
#3

[eluser]klezmer41[/eluser]
With your method, can I do this if the files are named the same?

$this->lang->load('file','idiom1');
$this->lang->load('file','idiom2');

Or do I need to use your method?

$this->lang->load('file',array('','idiom'));
#4

[eluser]xwero[/eluser]
you can do as you are used to but $this->lang->load('main',array('eng','fra')) is easier, not?
#5

[eluser]klezmer41[/eluser]
I can't seem to get yours to work, otherwise it sounds like a great idea...
#6

[eluser]xwero[/eluser]
How did you add it?
#7

[eluser]klezmer41[/eluser]
I replaced the class in the Language.php file and left everything else the same. Is there something else I need to do?
#8

[eluser]xwero[/eluser]
in the system/libraries directory?
#9

[eluser]klezmer41[/eluser]
Yep.
#10

[eluser]xwero[/eluser]
It works for me using
Code:
$this->lang->load('main',array('eng','fra'));

echo $this->lang->line('test','fra');
echo $this->lang->line('test','eng');
There are a few things i can think of why it doesn't work for you:

- the main file is named main.php instead of main_lang.php
- <?php is missing in the beginning of the file
- you didn't add the second parameter of the line method
- the index you call in the line method doesn't exist




Theme © iAndrew 2016 - Forum software by © MyBB