Welcome Guest, Not a member yet? Register   Sign In
Auto-loading language behaviour
#1

[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>&lt;?php echo lang('welcome_text'); ?&gt; 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 ^^
#2

[eluser]xwero[/eluser]
you forgot to add &lt;?php in the beginning of the language file
#3

[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 ^^




Theme © iAndrew 2016 - Forum software by © MyBB