Fixup a few minor documentation issues
Added some newlines Left a FIXME in LanguageNameIndexer.php Losslessly compressed display.png Change-Id: I884b423d3812ddb964a6a70f75a6331a73371165
This commit is contained in:
@@ -32,10 +32,11 @@ class UniversalLanguageSelectorHooks {
|
|||||||
$out->addModules( 'ext.uls.displaysettings' );
|
$out->addModules( 'ext.uls.displaysettings' );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResourceLoaderTestModules hook handler.
|
* ResourceLoaderTestModules hook handler.
|
||||||
* @param $testModules: array of javascript testing modules. 'qunit' is fed using tests/qunit/QUnitTestResources.php.
|
* @param $testModules array of javascript testing modules. 'qunit' is fed using tests/qunit/QUnitTestResources.php.
|
||||||
* @param $resourceLoader object
|
* @param $resourceLoader ResourceLoader
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function addTestModules( array &$testModules, ResourceLoader &$resourceLoader ) {
|
public static function addTestModules( array &$testModules, ResourceLoader &$resourceLoader ) {
|
||||||
@@ -47,6 +48,7 @@ class UniversalLanguageSelectorHooks {
|
|||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add some tabs for navigation for users who do not use Ajax interface.
|
* Add some tabs for navigation for users who do not use Ajax interface.
|
||||||
* Hooks: SkinTemplateNavigation, SkinTemplateTabs
|
* Hooks: SkinTemplateNavigation, SkinTemplateTabs
|
||||||
@@ -93,6 +95,7 @@ class UniversalLanguageSelectorHooks {
|
|||||||
$code = RequestContext::sanitizeLangCode( $code );
|
$code = RequestContext::sanitizeLangCode( $code );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook: ResourceLoaderGetConfigVars
|
* Hook: ResourceLoaderGetConfigVars
|
||||||
* @param $vars Array
|
* @param $vars Array
|
||||||
@@ -107,6 +110,9 @@ class UniversalLanguageSelectorHooks {
|
|||||||
/**
|
/**
|
||||||
* Add the template for the ULS to the body.
|
* Add the template for the ULS to the body.
|
||||||
* Hooks: SkinAfterContent
|
* Hooks: SkinAfterContent
|
||||||
|
* @param $data string
|
||||||
|
* @param $skin Skin
|
||||||
|
* @return bool
|
||||||
* TODO: move to JavaScript side
|
* TODO: move to JavaScript side
|
||||||
* TODO: hardcoded English
|
* TODO: hardcoded English
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class LanguageNameIndexer extends Maintenance {
|
|||||||
foreach ( $languages as $code => $name ) {
|
foreach ( $languages as $code => $name ) {
|
||||||
$all[$code][strtolower( $name )] = true;
|
$all[$code][strtolower( $name )] = true;
|
||||||
$langnames = LanguageNames::getNames( $code, 0, 2 );
|
$langnames = LanguageNames::getNames( $code, 0, 2 );
|
||||||
foreach ( $langnames as $code => $name ) {
|
foreach ( $langnames as $code => $name ) { // FIXME: Variable pollution
|
||||||
$all[$code][] = strtolower( $name );
|
$all[$code][] = strtolower( $name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,11 @@
|
|||||||
*/
|
*/
|
||||||
class LanguageNameSearch {
|
class LanguageNameSearch {
|
||||||
static $languagenames;
|
static $languagenames;
|
||||||
|
|
||||||
public static function init() {
|
public static function init() {
|
||||||
self::$languagenames = unserialize( file_get_contents( __DIR__ . '/langnames.ser' ) );
|
self::$languagenames = unserialize( file_get_contents( __DIR__ . '/langnames.ser' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function search( $searchKey, $typos = 0 ) {
|
public static function search( $searchKey, $typos = 0 ) {
|
||||||
if ( self::$languagenames === null ) {
|
if ( self::$languagenames === null ) {
|
||||||
self::init();
|
self::init();
|
||||||
@@ -61,6 +63,7 @@ class LanguageNameSearch {
|
|||||||
/**
|
/**
|
||||||
* Get the code point of first letter of string
|
* Get the code point of first letter of string
|
||||||
*
|
*
|
||||||
|
* @param $str string
|
||||||
* @return integer Code point of first letter of string
|
* @return integer Code point of first letter of string
|
||||||
*/
|
*/
|
||||||
static function getCodepoint( $str ) {
|
static function getCodepoint( $str ) {
|
||||||
@@ -84,6 +87,7 @@ class LanguageNameSearch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the Levenshtein distance between two strings
|
* Calculate the Levenshtein distance between two strings
|
||||||
* @param $str1
|
* @param $str1
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user