protected $mShowEmptyLabels = true;
/**
- * @var HTMLForm
+ * @var HTMLForm|null
*/
public $mParent;
* @return Message
*/
protected function getMessage( $value ) {
- if ( $value instanceof Message ) {
- return $value;
- } elseif ( $value instanceof MessageSpecifier ) {
- return Message::newFromKey( $value );
- } elseif ( is_array( $value ) ) {
- $msg = array_shift( $value );
- return $this->msg( $msg, $value );
- } else {
- return $this->msg( $value, [] );
+ $message = Message::newFromSpecifier( $value );
+
+ if ( $this->mParent ) {
+ $message->setContext( $this->mParent );
}
+
+ return $message;
}
/**