2022-01-03 17:37:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\TemplateData;
|
|
|
|
|
2024-10-20 11:20:47 +00:00
|
|
|
use MediaWiki\Language\Language;
|
2022-01-03 17:37:15 +00:00
|
|
|
use MessageLocalizer;
|
|
|
|
|
2022-02-03 11:45:27 +00:00
|
|
|
/**
|
2023-08-23 07:29:25 +00:00
|
|
|
* @license GPL-2.0-or-later
|
2022-02-03 11:45:27 +00:00
|
|
|
* @codeCoverageIgnore Trivial facade
|
|
|
|
*/
|
2022-01-03 17:37:15 +00:00
|
|
|
class TemplateDataMessageLocalizer implements MessageLocalizer {
|
|
|
|
|
2023-08-23 07:29:25 +00:00
|
|
|
private Language $language;
|
2022-01-03 17:37:15 +00:00
|
|
|
|
|
|
|
public function __construct( Language $language ) {
|
|
|
|
$this->language = $language;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @inheritDoc */
|
|
|
|
public function msg( $key, ...$params ) {
|
|
|
|
return wfMessage( $key, ...$params )->inLanguage( $this->language );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|