How to use multiple languages ​​in one view in CodeIgniter?

eg. I will download languages ​​such as (by the way, I think that only the first of these two, English will be downloaded, the others are ignored):

$this->lang->load('module_messages', 'english');
$this->lang->load('module_messages', 'czech');

But I can only use something like this:

echo $this->lang->line('language_key');

This does not work:

echo $this->lang->line('language_key', 'english');

Any idea how to echo simultaneously translate a language into the same representation, for example:

echo $this->lang->line('language_key', 'english');
echo $this->lang->line('language_key', 'czech');

How to achieve such a goal?

+5
source share
1 answer

Unfortunately, there is currently no way to do such a thing as keys being loaded for a single language file. This is simply not typical for downloading multiple files.

However, there is a way around this and use the prefix as follows:

$this->lang->load('en_module_messages', 'english');
$this->lang->load('cs_module_messages', 'czech');

echo $this->lang->line('en_language_key');
echo $this->lang->line('cs_language_key');

, . ISO . , .

+6

All Articles