I'm a new Fuel user, moved from Kohana. I cannot find how I can configure Fuel to use the Lang_Db class, so I can use a language table from MySQL.
I've tried some different settings in config.php for the option always_load: 'language' => array('db'=>true), 'language' => array('db'=>'db'), 'language' => array('filename'=>'db'), 'language' => array('file'=>'db')
They all didn't work and always load the Lang_Php class. What do I wrong?
hello vee, yes, unfortunately there's no instruction. the first thing is that the translation lines will not be saved as plain text, but as a serialized data.
to understand that consider following example: //load translations from APPPATH/lang/<lang-code>/fslang_test.php into a group named fslang_test \Lang::load('fslang_test', 'fslang_test'); // save ALL translation of group 'fslang_test' into a DB with fslang_test as identifier \Lang::save('fslang_test.db', 'fslang_test'); //then try to load from db... \Lang::load('fslang_test.db', 'fslang_test'); echo \Lang::get('fslang_test.fslang_test');
@Harro, i've already posted an issue, but, honestly, my understanting of that particular topic isn't at 100% (i still do not know what 'hash-column' stands for and why/how it is important) and my english isn't well either.
P.S. I made a task for converting all existing PHP-lang files (assuming they located in APPPATH/lang/<code>/) for all available languages (folders with lang-code in APPPATH/lang). Running task without any parameter will try to convert all located lang-files.
The problem with some RDBMS engines is that an UPDATE returns zero if no rows are updated (for example MySQL).
That means you can't check whether the update failed, or the update was a success but nothing had changed. And Lang needs to know the difference, otherwise it can't insert new language strings. This is what the hash is for, it will make sure an UPDATE query always updates the row.