mediawiki-extensions-Templa.../includes/TemplateDataMessageLocalizer.php
Thiemo Kreuz 94573e1152 Inject localizer service into HTML formatter class
Change-Id: I7f27b0c42e15ab939749c9dbe9eb51754580ca87
2022-02-01 15:59:32 +01:00

26 lines
466 B
PHP

<?php
namespace MediaWiki\Extension\TemplateData;
use Language;
use MessageLocalizer;
class TemplateDataMessageLocalizer implements MessageLocalizer {
/** @var Language */
private $language;
/**
* @param Language $language
*/
public function __construct( Language $language ) {
$this->language = $language;
}
/** @inheritDoc */
public function msg( $key, ...$params ) {
return wfMessage( $key, ...$params )->inLanguage( $this->language );
}
}