MissingTranslationEvent
API reference › yii › i18n › MissingTranslationEvent
MissingTranslationEvent represents the parameter for the MessageSource::EVENT_MISSING_TRANSLATION event.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$category | string | The category that the message belongs to Default: null. | MissingTranslationEvent |
$data | mixed | The data that is passed to Component::on() when attaching an event handler. Default: null. | yii\ |
$handled | bool | Whether the event is handled. Default: false. | yii\ |
$language | string | The language ID (e.g. en-US) that the message is to be translated to Default: null. | MissingTranslationEvent |
$message | string | The message to be translated. Default: null. | MissingTranslationEvent |
$name | string | The event name. Default: null. | yii\ |
$sender | object| | The sender of this event. Default: null. | yii\ |
$translatedMessage | string| | The translated message. Default: null. | MissingTranslationEvent |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Constructor. | yii\ |
__call() | Calls the named method which is not a class method. | yii\ |
__get() | Returns the value of an object property. | yii\ |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\ |
__set() | Sets value of an object property. | yii\ |
__unset() | Sets an object property to null. | yii\ |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\ |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\ |
className() static | Returns the fully qualified name of this class. | yii\ |
hasHandlers() static | Returns a value indicating whether there is any handler attached to the specified class-level event. | yii\ |
hasMethod() | Returns a value indicating whether a method is defined. | yii\ |
hasProperty() | Returns a value indicating whether a property is defined. | yii\ |
init() | Initializes the object. | yii\ |
off() static | Detaches an event handler from a class-level event. | yii\ |
offAll() static | Detaches all registered class-level event handlers. | yii\ |
on() static | Attaches an event handler to a class-level event. | yii\ |
trigger() static | Triggers a class-level event. | yii\ |
Property details
Section titled “Property details”$message
Section titled “$message ”public string $message = nullThe message to be translated.
An event handler may use this to provide a fallback translation
and set $translatedMessage if possible.
$translatedMessage
Section titled “$translatedMessage ”public string|null $translatedMessage = nullThe translated message.
An event handler may overwrite this property
with a translated version of $message if possible. If not set (null), it means the message is not translated.