Welcome Guest, Not a member yet? Register   Sign In
DALT - Database Application Language Translations
#1

[eluser]tdktank59[/eluser]
So I had the need to add some language support to my websites.

However I wanted to move it to the database to allow easier maintenance of it also allowing it easier to get things translated.

So here it is.
DB_Lang v0.0.1

Its pretty simple
I have included wiredesigns URI language identifier
http://codeigniter.com/wiki/URI_Language_Identifier

Usage is simple.

$this->lang->db_line($key);

use it the same way as the normal language line lookup
It is also smart so if the record does not exist it will create it and set a default value in the translated table.

It required 2 tables for a single lanauge
The key table wich holds the lookups. and the translated table which has the translated values.

language and lanugage_{lanauge}
I have included english and spanish since those were what I had on hand.

Let me know if you have any questions.
I will be adding some extra stuff later on to grab cookie info to see what the language is, as well as try and pull the browsers lanauge and/or other regional settings to try and detect what to send the user as a default lanauge. Otherwise it will default to what you set in CI
I also plan to have a config value that would allow you to cache the database results to a language file as well.


Messages In This Thread
DALT - Database Application Language Translations - by El Forum - 12-30-2009, 05:42 PM
DALT - Database Application Language Translations - by El Forum - 01-01-2010, 09:28 AM
DALT - Database Application Language Translations - by El Forum - 01-02-2010, 03:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB