_lang
. For example, initially create a file "english" which consists of another file data_lang.php with the translated data.
[html]
application/
|----language/
| |---english/
| | |---message_lang.php
| | | ……
| |---french/
| | |---message_lang.php
| | | ……
| |---german/
| | |---message_lang.php
| | | ……
| | ……
|
|
[/html]
Inside the language file (data_lang.php) the following code has to be entered by adding the required data to the array $lang
.
[php]$lang['language_key'] = 'The actual message to be shown';[/php]
Some of the language files will be as follows.
english/data_lang.php file:
[php]<?php
$lang['welcome_message'] = 'Welcome to SPLessons';[/php]
french/data_lang.php file:
[php]<?php
$lang['welcome_message'] = 'Bienvenue à SPLessons';[/php]
german/data_lang.php file:
[php]<?php
$lang['welcome_message'] = 'Willkommen in SPLessons';[/php]
__construct()
by entering the below code in it.
[php]$this->lang->load('message','english');[/php]
Note: All the controllers of the application should load the language files in the above process.
Once the language file is loaded, the data can be retrieved using below code.
[php]$this->lang->line('welcome_message');[/php]