|
Posted by Michael Fesser on 02/06/07 15:33
..oO(P Pulkkinen)
>"Michael Fesser" <netizen@gmx.de> wroite
>>
>> My framework is prepared for handling multilingual content. It's not
>> fully implemented yet, but the backend will most likely be the gettext
>> extension. I've worked with it in the past and like it.
>
>Is your framework open source :-)
Nope. It's just for private use and my personal "playground". I already
use it on some small production sites, but some parts of it are still
experimental or not fully implemented.
>> I also do that, because some parts of the content come from a DB. In my
>> framework every multilingual table consists of two "physical" tables in
>> the DB, e.g.
>
>Thanks. Outside of language thing, I would like to know, how this kinf of
>sister tables are declared in mysql. Or do you just manually keep their
>indexing in harmony, removing and inserting records at the same time to both
>tables.
Removing and updating records can be handled by the DB itself, using
FOREIGN KEY constraints (I can post an example if necessary). Inserting
new records requires a bit more action, but is usually done with a
script, not by hand.
>I ask this, because somethimes this kind of need rises up. For
>example, I could like to have a very minimalistic users-table and then have
>additional sister tables that are related to some specific installation or
>some extra module.
You can define what should happen in the sister tables if something in
the main table is changed or removed (in MySQL this requires the InnoDB
storage engine):
CREATE TABLE sisterTable (
...
FOREIGN KEY (recordId)
REFERENCES mainTable (recordId)
ON UPDATE CASCADE
ON DELETE CASCADE
) ENGINE=InnoDB;
Micha
Navigation:
[Reply to this message]
|