Yii Framework Forum: Translation of coreMessages from database not possible - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Translation of coreMessages from database not possible Rate Topic: -----

#1 User is offline   soeperees 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 26-October 09
  • Location:The Hague, The Netherlands

  Posted 28 October 2009 - 02:32 AM

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?
0

#2 User is offline   soeperees 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 26-October 09
  • Location:The Hague, The Netherlands

Posted 04 November 2009 - 01:17 AM

no one any idea?
0

#3 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 04 November 2009 - 02:20 AM

View Postsoeperees, 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?



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.
0

#4 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,876
  • Joined: 04-October 08
  • Location:DC, USA

Posted 04 November 2009 - 07:15 AM

You can configure the class of 'coreMessages' to be CDbMessageSource.
0

#5 User is offline   soeperees 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 26-October 09
  • Location:The Hague, The Netherlands

Posted 04 November 2009 - 12:22 PM

View Postjayrulez, 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.
0

#6 User is offline   Nabi 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 208
  • Joined: 22-February 12
  • Location:Ahwaz

Posted 26 March 2014 - 06:00 PM

View Postqiang, 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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users