Advanced Module Localisation (i18n)

edited February 2012 in Feature Requests
Hey there,
i feel stupid asking this, but I need some help with using the language helper's lang() function inside an advanced module.

Here's what I did

modulename/language/english/modulename_lang.php
contains my $lang array
 
$lang['test'] = "Test"
in my view i go

<?=lang('test');?>
result: nothing!

what am I doing wrong? what puzzles me is understanding how the language helper is supposed to load my language files without me having to tell.. ?

Comments

  • edited February 2012
    The language file needs to be loaded first before that will appear. To load you can do the following:
    $this->load->module_language('modulename', 'modulename');
    This is assuming the module the language file is in a module of "modulename" and is named "modulename_lang".
  • edited 6:57AM
    Thanks! This should really be in the lang library docs btw!!!
Sign In or Register to comment.