My pasteblog

This is not my Zettelkasten but a durable .bash_history

#symfony: RoVeRT: DB structure and sample info for I18N

,

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 smile', '', 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);

shell script via Apache/PHPRe:Modern web programmers have moved elsewhere (Score:1, Insightful)

Comments

queru Sunday, July 23, 2006 5:59:52 PM

Please... Can you gime me an example on how to internationalize a symfony app interface's using MySQL.

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.

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

February 2012
S M T W T F S
January 2012March 2012
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29