Hello,
I was not able to understand, from the current documentation, how does the translations works from the database…
I want to use as source language the english (en_us) language and as target language the italian language (it_it) …
In the config file I've specified the italian language:
'language'=>'it_it'
and in my database I've created the two tables as explained here:
http://www.yiiframew…DbMessageSource
But then I don't know how to set the type of my message source to "CDbMessageSource":
Quote
How can I do that? By now I've been able to load string from the:
protected/messages/it_it/CategoryName.php file …
but not from the database.
also is not clear to me how data should be entered in the two database tables; an example in the documentation would make it faster to understand…
anyway here is my test db tables (with contents):
CREATE TABLE IF NOT EXISTS `Message` ( `id` int(11) NOT NULL default '0', `language` varchar(16) NOT NULL default '', `translation` text, PRIMARY KEY (`id`,`language`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `Message` (`id`, `language`, `translation`) VALUES (1, 'it_it', 'Esci'), (1, 'en_us', 'Logout'); -- -------------------------------------------------------- CREATE TABLE IF NOT EXISTS `SourceMessage` ( `id` int(11) NOT NULL, `category` varchar(32) default NULL, `message` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `SourceMessage` (`id`, `category`, `message`) VALUES (1, 'main', 'Logout');
Thanks.
bye,
Giovanni.