Translation2 with MDB2 Container should probably be changed

From: Date: Fri, 25 Apr 2008 14:37:27 +0000
Subject: Translation2 with MDB2 Container should probably be changed
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28832@lists.php.net to get a copy of this message
Hello! I am using Translation2 with MDB2 container to store the translation strings. It works fine, however I think that it's not a good idea to alter the table every time you want to add new language. There has got to be a better way to add new language without the need to alter i18n table There is already another table that stores the list of available languages "lang_avail <tbl_structure.php?db=imagelogtest&table=tr2_lang_avail&token=4dcc0ed38792212d5cc0b5d53005c09f>" What is we just use the id from this table to identify the languageID for example, in i18n table instead of using a separate column for each language string, just use a column lang_avail_id (the value of 'id' from lang_avail table) So, if a site uses 3 languages, then there will be 3 rows for eash string/page value. If a site adds one more language then a new row can easily be added to the i18n for each string/page record (with different lang_avail_id) This should work just fine, My problem with altering table is this: let's say I have an open source project and use Translation2 package with database backend. A client installs my package, then he needs to add a new language support. He add a new language, his table schema changes because the i18n table is altered in his installation He then downloads an upgrade of my package. My package uses MDB2_Schema to automatically update the database schema, so it notices the difference between the latest schema and the client's schema and automatically alters his i18n table, he loses all translation strings for the language that he added before the upgrade. -- Open Source ALL content management with streaming video http://wiki.sharedlog.com

« previous php.pear.general (#28832) next »