r96414 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96413‎ | r96414 | r96415 >
Date:11:30, 7 September 2011
Author:svemir
Status:ok
Tags:
Comment:
use $wgLanguageCode for aspell dictionary
(user language option is about the interface, not content)
Modified paths:
  • /trunk/extensions/SphinxSearch/SphinxMWSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SphinxSearch/SphinxMWSearch.php
@@ -271,7 +271,7 @@
272272 }
273273
274274 function suggestWithAspell() {
275 - global $wgUser, $wgSphinxSearchPersonalDictionary, $wgSphinxSearchAspellPath;
 275+ global $wgLanguageCode, $wgSphinxSearchPersonalDictionary, $wgSphinxSearchAspellPath;
276276
277277 // aspell will only return mis-spelled words, so remember all here
278278 $words = $this->mTerms;
@@ -283,10 +283,7 @@
284284 // prepare the system call with optional dictionary
285285 $aspellcommand = 'echo ' . escapeshellarg( join( ' ', $words ) ) .
286286 ' | ' . escapeshellarg( $wgSphinxSearchAspellPath ) .
287 - ' -a --ignore-accents --ignore-case';
288 - if ( $wgUser ) {
289 - $aspellcommand .= ' --lang=' . $wgUser->getDefaultOption( 'language' );
290 - }
 287+ ' -a --ignore-accents --ignore-case --lang=' . $wgLanguageCode;
291288 if ( $wgSphinxSearchPersonalDictionary ) {
292289 $aspellcommand .= ' --home-dir=' . dirname( $wgSphinxSearchPersonalDictionary );
293290 $aspellcommand .= ' -p ' . basename( $wgSphinxSearchPersonalDictionary );

Status & tagging log