Jump to content

Dynamic Languages with CodeIgniter's Language System


Recommended Posts

So I am currently working on a website that is a business directory.  These listings are grouped by regions and categories.  My problem is that this website is going to be multilingual.  The regions and categories are stored in a database and I need to easily be able to both modify and access the language items based on the user's selected language.  I would prefer to store these names in CI's language files.

 

I've thought about creating a column in each table called "language index" so that would make it easy to call the items from the language file... for example  

foreach($query_categories->result_array() as $cat)
{
    $title = $this->language->item($cat['language_index']); 
}

But the bigger issue is editing the file if a category is modified or deleted(I can just add a new line to the end of the file if one is created).  What do you guys think would be the best way to store and modify names for different languages for each of these regions and categories?

Edited by ScottLacey
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.