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.
#6
Posted 26 March 2014 - 06:00 PM
qiang, on 04 November 2009 - 07:15 AM, said:
You can configure the class of 'coreMessages' to be CDbMessageSource.
Sorry for reply in old message.
But the type of coreMessages component is CPhpMessageSource and not CMessageSource be like messages component.
Quote
coreMessages CPhpMessageSource Returns the core message translations component. CApplication
So, don't work this way, is any idea for use coreMessages from Database?
وقتی پیغام میذارید، بی زحمت متنتون رو انتخاب کنید و این دو تا کار ناقابل رو هم انجام بدید:
1. از اون بالا RTL رو انتخاب کنید.
2. فونت رو هم Tahoma بگذارید.
که چشممون در نیاد.
دمت گرم!
www.IranPHP.ir
Share this topic:
Page 1 of 1