3 namespace Wikimedia\Message
;
6 * ITextFormatter is a simplified interface to the Message class. It converts
7 * MessageValue message specifiers to localized text in a certain language.
9 * MessageValue supports message keys, and parameters with a wide variety of
10 * types. It does not expose any details of how messages are retrieved from
11 * storage or what format they are stored in.
13 * Thus, TextFormatter supports single message keys, but not the concept of
14 * presence or absence of a key from storage. So it does not support
15 * fallback sequences of multiple keys.
17 * The caller cannot modify the details of message translation, such as which
18 * of multiple sources the message is taken from. Any such flags may be injected
19 * into the factory constructor.
21 * Implementations of TextFormatter are not required to perfectly format
22 * any message in any language. Implementations should make a best effort to
23 * produce human-readable text.
25 * @package MediaWiki\MessageFormatter
27 interface ITextFormatter
{
29 * Get the internal language code in which format() is
32 function getLangCode();
35 * Convert a MessageValue to text.
37 * The result is not safe for use as raw HTML.
39 * @param MessageValue $message
42 function format( MessageValue
$message );