Commit 2a6bc68c by Qiang Xue

minor fixes.

parent c229ba72
...@@ -114,8 +114,10 @@ class MessageSource extends Component ...@@ -114,8 +114,10 @@ class MessageSource extends Component
'language' => $language, 'language' => $language,
]); ]);
$this->trigger(self::EVENT_MISSING_TRANSLATION, $event); $this->trigger(self::EVENT_MISSING_TRANSLATION, $event);
if ($event->translatedMessage !== false) { if ($event->translatedMessage !== null) {
return $this->_messages[$key][$message] = $event->translatedMessage; return $this->_messages[$key][$message] = $event->translatedMessage;
} else {
return $this->_messages[$key][$message] = false;
} }
} }
return false; return false;
......
...@@ -23,11 +23,10 @@ class MissingTranslationEvent extends Event ...@@ -23,11 +23,10 @@ class MissingTranslationEvent extends Event
*/ */
public $message; public $message;
/** /**
* @var string|boolean the translated message. An event handler may overwrite this property * @var string the translated message. An event handler may overwrite this property
* with a translated version of [[message]] if possible. Defaults to false meaning no translation * with a translated version of [[message]] if possible. If not set (null), it means the message is not translated.
* is available.
*/ */
public $translatedMessage = false; public $translatedMessage;
/** /**
* @var string the category that the message belongs to * @var string the category that the message belongs to
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment