views:

530

answers:

1

Hi,

i need to create a form in cakephp so that i can insert content in multiple language at the same time

let's say eng and esp

the form will be like:

Insert english title _____________
Insert spanish title _____________

i'm using i18n for the translated fields but the documentation doesn't say much, can anyone give me some advice? also, how can i know how many languages i'm using? do i have to count the directoryes in app/locale?

+1  A: 

I keep an array in bootstrap.php for all the languages the site is supposed to support. As for inserting translations, if you pass something like:

$data = array('ModelName' => array(
  'field_name' => array(
    'eng' => 'This is my name',
    'deu' => 'Das ist mein name'
  )
));

it will properly insert those in the i18n table.

cosmin