2

My language file (application/language/english/english_lang.php);

$CI =& get_instance(); 

foreach($CI->db->get('language')->result() as $language):

    $lang[''.$language->name.''] = "".$language->turkish.".";

endforeach;

My database;

SELECT id, name, english, turkish, create_date FROM language WHERE 1

My view file;

echo lang('title','title');

But it is not working...

Mansfield
  • 14,445
  • 18
  • 76
  • 112
Burak
  • 21
  • 1
  • 2
  • http://stackoverflow.com/questions/1328420/the-best-way-to-make-codeigniter-website-multi-language-calling-from-lang-array –  Aug 15 '12 at 01:23
  • 1
    Did you actually read the codeigniter documentation? Here: http://codeigniter.com/user_guide/libraries/language.html. And are you sure you want to hit the database on every page load just to retrieve the text lines. What happends when you have a million lines in the database? – Dan F. Aug 20 '12 at 14:49

1 Answers1

0

This looks like the solution:

Language Class Extended DB

Goce Ribeski
  • 1,352
  • 13
  • 30