CodeIgniter Forums
Two different languages at the same time - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Two different languages at the same time (/thread-26546.html)



Two different languages at the same time - El Forum - 01-16-2010

[eluser]Unknown[/eluser]
I have shared content for all languages (same keywords, same values). So I'd like to keep this data in one place. For that I've created language called shared.

Now I'd like to load two lang_files from different languages:

Code:
$this->lang->load('interface', 'english');
$this->lang->load('interface', 'shared');

unfortunately it loads only english but not shared.

English and shared contains different keywords !


Two different languages at the same time - El Forum - 01-17-2010

[eluser]ShiverCube[/eluser]
What you are asking makes little sense. A language file should contain data specific to one language.

But if you must, just add an include statement in each of the language files. So for the english.php language file:
Code:
include(APPPATH.'language/shared/interface'.EXT);

$lang...

Then you only have to load the one language (as you should do anyway):
Code:
$this->lang->load('interface', 'english');



Two different languages at the same time - El Forum - 01-17-2010

[eluser]Unknown[/eluser]
Thanks.. Smile