1<?php
2
3namespace Wikimedia\Message;
4
5/**
6 * Converts MessageValue message specifiers to localized plain text in a certain language.
7 *
8 * The caller cannot modify the details of message translation, such as which
9 * of multiple sources the message is taken from. Any such flags may be injected
10 * into the factory constructor.
11 *
12 * Implementations of TextFormatter are not required to perfectly format
13 * any message in any language. Implementations should make a best effort to
14 * produce human-readable text.
15 *
16 * @package MediaWiki\MessageFormatter
17 */
18interface ITextFormatter {
19	/**
20	 * Get the internal language code in which format() is
21	 * @return string
22	 */
23	public function getLangCode();
24
25	/**
26	 * Convert a MessageValue to text.
27	 *
28	 * The result is not safe for use as raw HTML.
29	 *
30	 * @param MessageValue $message
31	 * @return string
32	 */
33	public function format( MessageValue $message );
34}
35