Class CMessageSource
CMessageSource is the base class for message translation repository classes.
A message source is an application component that provides message internationalization (i18n). It stores messages translated in different languages and provides these translated versions when requested.
A concrete class must implement CMessageSource::loadMessages()
or override CMessageSource::translateMessage()
.
- CComponent
- CApplicationComponent implements IApplicationComponent
- CMessageSource
Package: system\i18n
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/i18n/CMessageSource.php
abstract protected
array
|
#
loadMessages( string $category, string $language )
Loads the message translation for the specified language and category. |
public
string
|
|
public
|
|
public
string
|
|
protected
string
|
#
translateMessage( string $category, string $message, string $language )
Translates the specified message. If the message is not found, an |
public
|
#
onMissingTranslation(
Raised when a message cannot be translated. Handlers may log this message or
do some default handling. The |
getIsInitialized(),
init()
|
public
boolean
|
$forceTranslation | false |
#
whether to force message translation when the source and target languages are the same. Defaults to false, meaning translation is only performed when source and target languages are different. |
$behaviors
|
public
string
|
$language |
#
The language that the source messages are written in. Defaults to CApplication::language application language. |
$isInitialized
|