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:
Reedy
2012-08-19 01:19:46 +01:00
parent 08eb45509b
commit 0f0732f865
4 changed files with 13 additions and 3 deletions

View File

@@ -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
*/ */

View File

@@ -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 );
} }
} }

View File

@@ -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