ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Codeigniter Multilanguage Question

February 01, 2009 11:44am

Subscribe [2]
  • #1 / Feb 01, 2009 11:44am

    JayArias

    45 posts

    Hello , I am creating a cms that will present massive amounts of news to large Latino and American groups here in the united states and in other regions of the world. My question is; is there any way/plug ins/scripts that I can use to translate the data presented on the website?

    eg:

    <<?=anchor(''.$SITE_URL.'/en', 'English');?> |<?=anchor(''.$SITE_URL.'/es', 'Enspanol');?>
  • #2 / Feb 01, 2009 6:00pm

    Phil Sturgeon

    2889 posts

    The best way to do this is find some way of remembering what language to use, then set a constant with that language code very early on. Here you would take the last URI string (using array_pop() in a pre controller hook perhaps?) and set define(‘LANG_CODE’, ‘en’) or whatever fr all of CI to see.

    You cannot actually translate page content without hooking into google Translate or some other third-party lib, but you can easily have language specific content. By storing a language code in the database next to the content, you can say “SELECT * FROM news WHERE lang = ‘en’ or lang = ‘’” and you have your site accepting multi-lang.

    If you need a little help with this here is a post with a few examples on how to do this.

    How to make a multi country web site? (Best practices)

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases