Hi everyone,
I've setup an application with internationalisation from database. While I have all my custom messages in that database, I thought I could just as well put all the coreMessages in there. This however seems not possible because CApplication.coreMessages is of type CPhpMessageSource.
Why isn't coreMessages of type CMessageSource?
Page 1 of 1
Translation of coreMessages from database not possible
#3
Posted 04 November 2009 - 02:20 AM
soeperees, on 28 October 2009 - 02:32 AM, said:
Hi everyone,
I've setup an application with internationalisation from database. While I have all my custom messages in that database, I thought I could just as well put all the coreMessages in there. This however seems not possible because CApplication.coreMessages is of type CPhpMessageSource.
Why isn't coreMessages of type CMessageSource?
I've setup an application with internationalisation from database. While I have all my custom messages in that database, I thought I could just as well put all the coreMessages in there. This however seems not possible because CApplication.coreMessages is of type CPhpMessageSource.
Why isn't coreMessages of type CMessageSource?
If that were the case then yii would require a database connection to work properly, it would probably need to be distributed with the data for the multiple database schemas it supports. You could possibly modify the core to suit your needs. I'm sure you could see the implications of all that.
php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";
python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]
ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}
You say Tomato, I say Tomato.
#4
Posted 04 November 2009 - 07:15 AM
You can configure the class of 'coreMessages' to be CDbMessageSource.
#5
Posted 04 November 2009 - 12:22 PM
jayrulez, on 04 November 2009 - 02:20 AM, said:
If that were the case then yii would require a database connection to work properly, it would probably need to be distributed with the data for the multiple database schemas it supports. You could possibly modify the core to suit your needs. I'm sure you could see the implications of all that.
I didn't say "CDbMessageSource", but "CMessageSource". It's the same class "messages" derives from. For messages you can make the choice to use a database or not. In that case a database connection wouln't be required, am I right?
I do not want to mess with the core because updates would kill my app.
Share this topic:
Page 1 of 1

Help













