#symfony: RoVeRT: DB structure and sample info for I18N
Sunday, 22. January 2006, 15:01:20
http://symfony.pastebin.com/517490
Posted by RoVeRT on Sun 22nd Jan 14:51 (modification of posting from RoVeRT show diff)
diff | download | new post
# Table structure for table `catalogue`
#
CREATE TABLE `catalogue` (
`cat_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '',
`source_lang` varchar(100) NOT NULL DEFAULT '',
`target_lang` varchar(100) NOT NULL DEFAULT '',
`date_created` int(11) NOT NULL DEFAULT '0',
`date_modified` int(11) NOT NULL DEFAULT '0',
`author` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`cat_id`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;
#
# Dumping data for table `catalogue`
#
INSERT INTO `catalogue` VALUES (1, 'messages', '', '', 0, 0, '');
INSERT INTO `catalogue` VALUES (2, 'messages.en', '', '', 0, 0, '');
INSERT INTO `catalogue` VALUES (3, 'messages.en_AU', '', '', 0, 0, '');
# --------------------------------------------------------
#
# Table structure for table `trans_unit`
#
CREATE TABLE `trans_unit` (
`msg_id` int(11) NOT NULL AUTO_INCREMENT,
`cat_id` int(11) NOT NULL DEFAULT '1',
`id` varchar(255) NOT NULL DEFAULT '',
`source` text NOT NULL,
`target` text NOT NULL,
`comments` text NOT NULL,
`date_added` int(11) NOT NULL DEFAULT '0',
`date_modified` int(11) NOT NULL DEFAULT '0',
`author` varchar(255) NOT NULL DEFAULT '',
`translated` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`msg_id`)
) TYPE=MyISAM AUTO_INCREMENT=6 ;
#
# Dumping data for table `trans_unit`
#
INSERT INTO `trans_unit` VALUES (1, 1, '1', 'Hello', 'Hello World', '', 0, 0, '', 1);
INSERT INTO `trans_unit` VALUES (2, 2, '', 'Hello', 'Hello
', '', 0, 0, '', 0);
INSERT INTO `trans_unit` VALUES (3, 1, '1', 'Welcome', 'Welcome', '', 0, 0, '', 0);
INSERT INTO `trans_unit` VALUES (4, 3, '', 'Hello', 'G\'day Mate!', '', 0, 0, '', 0);
INSERT INTO `trans_unit` VALUES (5, 3, '', 'Welcome', 'Welcome Mate!', '', 0, 0, '', 0);
Posted by RoVeRT on Sun 22nd Jan 14:51 (modification of posting from RoVeRT show diff)
diff | download | new post
# Table structure for table `catalogue`
#
CREATE TABLE `catalogue` (
`cat_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '',
`source_lang` varchar(100) NOT NULL DEFAULT '',
`target_lang` varchar(100) NOT NULL DEFAULT '',
`date_created` int(11) NOT NULL DEFAULT '0',
`date_modified` int(11) NOT NULL DEFAULT '0',
`author` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`cat_id`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;
#
# Dumping data for table `catalogue`
#
INSERT INTO `catalogue` VALUES (1, 'messages', '', '', 0, 0, '');
INSERT INTO `catalogue` VALUES (2, 'messages.en', '', '', 0, 0, '');
INSERT INTO `catalogue` VALUES (3, 'messages.en_AU', '', '', 0, 0, '');
# --------------------------------------------------------
#
# Table structure for table `trans_unit`
#
CREATE TABLE `trans_unit` (
`msg_id` int(11) NOT NULL AUTO_INCREMENT,
`cat_id` int(11) NOT NULL DEFAULT '1',
`id` varchar(255) NOT NULL DEFAULT '',
`source` text NOT NULL,
`target` text NOT NULL,
`comments` text NOT NULL,
`date_added` int(11) NOT NULL DEFAULT '0',
`date_modified` int(11) NOT NULL DEFAULT '0',
`author` varchar(255) NOT NULL DEFAULT '',
`translated` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`msg_id`)
) TYPE=MyISAM AUTO_INCREMENT=6 ;
#
# Dumping data for table `trans_unit`
#
INSERT INTO `trans_unit` VALUES (1, 1, '1', 'Hello', 'Hello World', '', 0, 0, '', 1);
INSERT INTO `trans_unit` VALUES (2, 2, '', 'Hello', 'Hello
INSERT INTO `trans_unit` VALUES (3, 1, '1', 'Welcome', 'Welcome', '', 0, 0, '', 0);
INSERT INTO `trans_unit` VALUES (4, 3, '', 'Hello', 'G\'day Mate!', '', 0, 0, '', 0);
INSERT INTO `trans_unit` VALUES (5, 3, '', 'Welcome', 'Welcome Mate!', '', 0, 0, '', 0);



queru # 23. July 2006, 17:59
I've read the source file "sfMessageSource.class.php":
The following example instantiates a MySQL message source, set the culture,
set the cache handler, and use the source in a message formatter.
The messages are store in a database named essages". The source parameter
for the actory method is a PEAR DB style DSN.
$dsn = 'mysql://username:password@localhost/messages';
$source = sfMessageSource::factory('MySQL', $dsn);
//set the culture and cache, store the cache in the /tmp directory.
$source->setCulture('en_AU')l
$source->setCache(new sfMessageCache('/tmp'));
$formatter = new sfMessageFormat($source);
But it's not yet clarifier for me:
¿What is the database sctructure needed?
- Ok. Solved. The structure of this page.
¿How I can put these $formatter to work?
¿Is there any method to fill this i18n tables with actual strings from my code?
¿How I can test if formatter is working?
Thanks.