*/
protected $config;
- public function __construct( Config $config ) {
+ /**
+ * Current language
+ * @var Language
+ */
+ private $language;
+ public function __construct( Config $config, Language $lang ) {
$this->config = $config;
+ $this->language = $lang;
}
/**
* @return null|Title
*/
protected function getNearMatchInternal( $searchterm ) {
- $lang = $this->config->get( 'ContLang' );
+ $lang = $this->language;
$allSearchTerms = [ $searchterm ];
}
foreach ( $allSearchTerms as $term ) {
-
# Exact match? No need to look further.
$title = Title::newFromText( $term );
if ( is_null( $title ) ) {