Language problem |
Hi everybody;
I create a website using both english, french and spanish languages as a user may choose. This work perfectly at the homegage since I don't use language helper (I use post and session). My problem appear later at a form page. I followed the Language Class tutorial (https://www.codeigniter.com/user_guide/l...guage.html) and created dedicated files: application/language/english/connect_lang.php application/language/french/connect_lang.php application/language/spanish/connect_lang.php all of them filled respectively with things like: //for french $lang['pas_de_compte'] => "Je n'ai pas encore de compte"; $lang['a_compte'] => "J'ai déjà un compte"; //for english $lang['pas_de_compte'] => "I have no account yet"; $lang['a_compte'] => "I already have an account"; // for spanish $lang['pas_de_compte'] = "Aun no tengo cuenta"; $lang['a_compte'] = "Ya tengo una cuenta"; I catch the language used by the Connect.php controller with: $langue = $this->session->userdata('langue'); $idiom=['fr'=>'french', 'en'=>'english', 'es' => 'spanish']; My problem is that when I use : $this->lang->load('connect', $idiom[$langue]); the language file is correctly found but the array of keys/values is printed directly in the HTML as a whole file instead of filling each label or text field. Things happen the same when I use that in the view instead of the controller. I don't understand why nor how to fix it. code result: Code: <!DOCTYPE html> As you cas see, the lang file is found, its key/value array is printed without being requested, and the labels are printed but empty. |
Messages In This Thread |
Language problem - by ji_louis - 06-26-2019, 05:12 PM
RE: Language problem - by InsiteFX - 06-27-2019, 03:04 AM
RE: Language problem - by ji_louis - 06-30-2019, 08:07 AM
RE: Language problem - by includebeer - 06-28-2019, 05:37 AM
RE: Language problem - by ji_louis - 06-30-2019, 08:14 AM
RE: Language problem - by Wouter60 - 06-30-2019, 11:24 PM
|