How to use Internationalization in Codeigniter

How to use Internationalization in Codeigniter

In Language File Create your Label
language\english\message_lang.php
$lang[‘greet’] = ‘Hi’;
language\spanish\message_lang.php
$lang[‘greet’] = ‘Holla’;

In Controller Action

$data[‘lang_greet’] = $this->lang->line(‘greet’);

In View

Add a Comment

Your email address will not be published. Required fields are marked *