Hey guys,
well, I have to actions: ADD and EDIT.
Eventually we can write a specific one: ADD_TRANSLATION
Everything works fine if I maniulate the database entries manually
after adding the first record. Namely I put the same id in table i18n
"row_id":
---------------------------------------------------------------------
CREATE TABLE `sections` (
`id` smallint(2) NOT NULL auto_increment,
`title` varchar(255) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `sections`
--
INSERT INTO `sections` (`id`, `title`) VALUES
(1, 'pubblicazioni'),
---------------------------------------------------------------------
INSERT INTO `i18n` (`id`, `locale`, `i18n_content_id`, `model`,
`row_id`, `field`) VALUES
(1, 'ita', 1, 'Section', 1, 'introduction'),
(2, 'en_gb', 2, 'Section', 1, 'introduction');
---------------------------------------------------------------------
INSERT INTO `i18n_content` (`id`, `content`) VALUES
(1, 'appuntamenti IT'),
(2, 'appuntamenti EN');
---------------------------------------------------------------------
In my section model I have:
var $actsAs = array('Translate' => array('introduction'));
---------------------------------------------------------------------
My edit view is:
<?php
echo $form->input('id');
echo $form->input('title');
echo $form->input('introduction', array('type' => 'textarea'));
?>
If I add a further record, everything ok: if my locale is 'en_gb'the
field 'introduction' gets added in the i18n tables as 'en_gb'.
Now I don't have the italian translation. Therefore I edit record 2
(after switching language to locale 'ita'. nevertheless a FULL new
record is added, while I would just like the 'introduction'
translation to be added.
By the way, language switching is administered as described in the
P28n tutorial in the Bakery.
Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---