![]() |
Auto-loading language behaviour - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Auto-loading language behaviour (/showthread.php?tid=15464) |
Auto-loading language behaviour - El Forum - 02-05-2009 [eluser]Elianora la blanche[/eluser] Hi there ! I'm new with codeigniter and try to understand how to use Language class with language files. I auto-load language class, language helper and my 'french' language file when I go to any page I see a sort of print_r array at the top, before any html output this print the $lang array as written in the language file I can't echo any translated string in my views, it seems to do nothing for example, I use the base welcome controller (welcome.php), and I put this in welcome view (welcome_message.php) Code: <h1><?php echo lang('welcome_text'); ?> CodeIgniter</h1> I have this in my language file (french_lang.php) Code: $lang['welcome_text'] = "Bienvenue sur le site de test de"; I think I missed something, but can't see what... any help would be welcome thanks in advance and sorry for my english ^^ Auto-loading language behaviour - El Forum - 02-05-2009 [eluser]xwero[/eluser] you forgot to add <?php in the beginning of the language file Auto-loading language behaviour - El Forum - 02-05-2009 [eluser]Elianora la blanche[/eluser] thanks for this quick answer :p I feel so stupid now, it was very simple, but I really didn't see it now I can try to play with gettext translation ^^ |