Interface for message objects used by MessageCollection. More...
Public Member Functions | |
| __construct (private readonly string $key, private readonly ?string $definition,) | |
| Creates new message object. | |
| key () | |
| Get the message key. | |
| definition () | |
| Get the message definition. | |
| rawDefinition () | |
| translation () | |
| Get the message translation. | |
| setInfile (string $text) | |
| Set the committed translation. | |
| infile () | |
| Returns the committed translation. | |
| addTag (string $tag) | |
| Add a tag for this message. | |
| hasTag (string $tag) | |
| Check if this message has a given tag. | |
| getTags () | |
| Return all tags for this message. | |
| setProperty (string $key, $value) | |
| appendProperty (string $key, $value) | |
| getProperty (string $key) | |
| getPropertyNames () | |
| Get all the available property names. | |
Protected Attributes | |
| string | $infile = null |
| Committed in-file translation. | |
| array | $tags = [] |
| array | $props = [] |
| Message properties. | |
| array | $reviewers = [] |
Interface for message objects used by MessageCollection.
Definition at line 13 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::__construct | ( | private readonly string | $key, |
| private readonly ?string | $definition ) |
Creates new message object.
| string | $key | Unique key identifying this message. |
| string | null | $definition | The authoritave definition of this message. |
Definition at line 30 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::addTag | ( | string | $tag | ) |
Add a tag for this message.
Definition at line 68 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::appendProperty | ( | string | $key, |
| $value ) |
| string | $key | |
| mixed | $value |
Definition at line 97 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::definition | ( | ) |
Get the message definition.
Message definition should not be empty, but sometimes is. See: https://phabricator.wikimedia.org/T285830
Definition at line 46 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::getProperty | ( | string | $key | ) |
Reimplemented in MediaWiki\Extension\Translate\MessageLoading\ThinMessage.
Definition at line 105 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::getPropertyNames | ( | ) |
Get all the available property names.
Reimplemented in MediaWiki\Extension\Translate\MessageLoading\ThinMessage.
Definition at line 110 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::getTags | ( | ) |
| MediaWiki\Extension\Translate\MessageLoading\Message::hasTag | ( | string | $tag | ) |
Check if this message has a given tag.
Definition at line 73 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::infile | ( | ) |
Returns the committed translation.
Definition at line 63 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::key | ( | ) |
Get the message key.
Definition at line 37 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::rawDefinition | ( | ) |
Definition at line 50 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::setInfile | ( | string | $text | ) |
Set the committed translation.
Definition at line 58 of file Message.php.
| MediaWiki\Extension\Translate\MessageLoading\Message::setProperty | ( | string | $key, |
| $value ) |
| string | $key | |
| mixed | $value |
Definition at line 89 of file Message.php.
|
abstract |
Get the message translation.
Reimplemented in MediaWiki\Extension\Translate\MessageLoading\FatMessage, and MediaWiki\Extension\Translate\MessageLoading\ThinMessage.
|
protected |
Committed in-file translation.
Definition at line 16 of file Message.php.
|
protected |
Message properties.
Definition at line 20 of file Message.php.
|
protected |
Definition at line 22 of file Message.php.
|
protected |
Definition at line 18 of file Message.php.