The new translation behavior of cake 1.2 will handle the translation
in the db.
To use init the I18n db tables from the sql at /app/config/sql/
i18n.sql (should be there in a freshly baked 1.2 app).
In your model do something like:
var $actsAs = array('Translate' => array(
'title' => 'Translations',
'abstract' => 'TranslationsAbstract',
'text' => 'TranslationsText',
);
for each of your translateable fields add a key to the array. by using
'field'=>'relationname' you create a hasMany relation for that field
that can be accessed in the data like any other hasMany relation, but
you can also just set the Fields like array('title' ,'abstract',
'text'). The field values will then just be set without extra
relations. Well even with the relations the translated value will just
get set, but the hasMany relation is useful for getting all
translations if you need it.
:jcs
On 1 Jun., 01:23, oleonav <[EMAIL PROTECTED]> wrote:
> What I mean is for example a database with news articles. For every
> article there is a version in each language supported by the website.
> Based on the language settings made by the user a localised copy of
> the article is shown. If a localised version of the article is not
> available than the version in the default site language is shown, for
> example English.
>
> Symfony uses a table structure like this:
>
> Table: news
> Fields: id, ...
>
> Table news_i18n
> Fields: id, news_id, language, title, content, ...
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---