MediaWiki REL1_34
Scribunto_LuaLanguageLibrary Class Reference
Inheritance diagram for Scribunto_LuaLanguageLibrary:
Collaboration diagram for Scribunto_LuaLanguageLibrary:

Public Member Functions

 convertGrammar ( $lang, $args)
 convertGrammar handler
 
 convertPlural ( $lang, $args)
 convertPlural handler
 
 fetchLanguageName ( $code, $inLanguage)
 Handler for fetchLanguageName.
 
 fetchLanguageNames ( $inLanguage, $include)
 Handler for fetchLanguageNames.
 
 formatDate ( $lang, $args)
 formatDate handler
 
 formatDuration ( $lang, $args)
 formatDuration handler
 
 formatNum ( $lang, $args)
 formatNum handler
 
 gender ( $lang, $args)
 gender handler
 
 getContLangCode ()
 Handler for getContLangCode.
 
 getDurationIntervals ( $lang, $args)
 getDurationIntervals handler
 
 getFallbacksFor ( $code)
 Handler for fetchLanguageNames.
 
 isKnownLanguageTag ( $code)
 Handler for isKnownLanguageTag.
 
 isSupportedLanguage ( $code)
 Handler for isSupportedLanguage.
 
 isValidBuiltInCode ( $code)
 Handler for isValidBuiltInCode.
 
 isValidCode ( $code)
 Handler for isValidCode.
 
 languageMethod ( $name, $args)
 Language object method handler.
 
 register ()
 Called to register the library.
 
- Public Member Functions inherited from Scribunto_LuaLibraryBase
 __construct (Scribunto_LuaEngine $engine)
 
 incrementExpensiveFunctionCount ()
 Increment the expensive function count, and throw if limit exceeded.
 

Public Attributes

 $langCache = []
 
 $maxLangCacheSize
 
 $timeCache = []
 

Additional Inherited Members

- Protected Member Functions inherited from Scribunto_LuaLibraryBase
 checkType ( $name, $argIdx, $arg, $expectType)
 Check the type of a variable.
 
 checkTypeOptional ( $name, $argIdx, &$arg, $expectType, $default)
 Check the type of a variable, with default if null.
 
 getEngine ()
 Get the engine.
 
 getInterpreter ()
 Get the interpreter.
 
 getLuaType ( $var)
 Get the Lua type corresponding to the type of the variable.
 
 getParser ()
 Get the parser.
 
 getParserOptions ()
 Get the parser options.
 
 getTitle ()
 Get the title.
 

Detailed Description

Definition at line 5 of file LanguageLibrary.php.

Member Function Documentation

◆ convertGrammar()

Scribunto_LuaLanguageLibrary::convertGrammar ( $lang,
$args )

convertGrammar handler

Definition at line 233 of file LanguageLibrary.php.

References $args, $lang, and Scribunto_LuaLibraryBase\checkType().

◆ convertPlural()

Scribunto_LuaLanguageLibrary::convertPlural ( $lang,
$args )

convertPlural handler

Definition at line 216 of file LanguageLibrary.php.

References $args, $lang, and Scribunto_LuaLibraryBase\checkType().

◆ fetchLanguageName()

Scribunto_LuaLanguageLibrary::fetchLanguageName ( $code,
$inLanguage )

Handler for fetchLanguageName.

Definition at line 122 of file LanguageLibrary.php.

References Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\checkTypeOptional().

◆ fetchLanguageNames()

Scribunto_LuaLanguageLibrary::fetchLanguageNames ( $inLanguage,
$include )

Handler for fetchLanguageNames.

Definition at line 135 of file LanguageLibrary.php.

References Scribunto_LuaLibraryBase\checkTypeOptional().

◆ formatDate()

Scribunto_LuaLanguageLibrary::formatDate ( $lang,
$args )

◆ formatDuration()

Scribunto_LuaLanguageLibrary::formatDuration ( $lang,
$args )

formatDuration handler

Definition at line 394 of file LanguageLibrary.php.

References $args, $lang, Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\checkTypeOptional().

◆ formatNum()

Scribunto_LuaLanguageLibrary::formatNum ( $lang,
$args )

formatNum handler

Definition at line 297 of file LanguageLibrary.php.

References $args, $lang, and Scribunto_LuaLibraryBase\checkType().

◆ gender()

Scribunto_LuaLanguageLibrary::gender ( $lang,
$args )

◆ getContLangCode()

Scribunto_LuaLanguageLibrary::getContLangCode ( )

Handler for getContLangCode.

Definition at line 61 of file LanguageLibrary.php.

References $wgContLang.

◆ getDurationIntervals()

Scribunto_LuaLanguageLibrary::getDurationIntervals ( $lang,
$args )

getDurationIntervals handler

Definition at line 413 of file LanguageLibrary.php.

References $args, $lang, Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\checkTypeOptional().

◆ getFallbacksFor()

Scribunto_LuaLanguageLibrary::getFallbacksFor ( $code)

Handler for fetchLanguageNames.

Definition at line 147 of file LanguageLibrary.php.

References Scribunto_LuaLibraryBase\checkType().

◆ isKnownLanguageTag()

Scribunto_LuaLanguageLibrary::isKnownLanguageTag ( $code)

Handler for isKnownLanguageTag.

Definition at line 88 of file LanguageLibrary.php.

References Scribunto_LuaLibraryBase\checkType().

◆ isSupportedLanguage()

Scribunto_LuaLanguageLibrary::isSupportedLanguage ( $code)

Handler for isSupportedLanguage.

Definition at line 72 of file LanguageLibrary.php.

References Scribunto_LuaLibraryBase\checkType().

◆ isValidBuiltInCode()

Scribunto_LuaLanguageLibrary::isValidBuiltInCode ( $code)

Handler for isValidBuiltInCode.

Definition at line 110 of file LanguageLibrary.php.

References Scribunto_LuaLibraryBase\checkType().

◆ isValidCode()

Scribunto_LuaLanguageLibrary::isValidCode ( $code)

Handler for isValidCode.

Definition at line 99 of file LanguageLibrary.php.

References Scribunto_LuaLibraryBase\checkType().

◆ languageMethod()

Scribunto_LuaLanguageLibrary::languageMethod ( $name,
$args )

Language object method handler.

Definition at line 165 of file LanguageLibrary.php.

References $args, $lang, Scribunto_LuaLibraryBase\checkType(), and Scribunto_LuaLibraryBase\getLuaType().

◆ register()

Scribunto_LuaLanguageLibrary::register ( )

Called to register the library.

This should do any necessary setup and then call $this->getEngine()->registerInterface(). The value returned by that call should be returned from this function, and must be for 'deferLoad' libraries to work right.

Returns
array Lua package

Reimplemented from Scribunto_LuaLibraryBase.

Definition at line 10 of file LanguageLibrary.php.

References $args, $wgContLang, and Scribunto_LuaLibraryBase\getEngine().

Member Data Documentation

◆ $langCache

Scribunto_LuaLanguageLibrary::$langCache = []

Definition at line 6 of file LanguageLibrary.php.

◆ $maxLangCacheSize

Scribunto_LuaLanguageLibrary::$maxLangCacheSize

Definition at line 8 of file LanguageLibrary.php.

◆ $timeCache

Scribunto_LuaLanguageLibrary::$timeCache = []

Definition at line 7 of file LanguageLibrary.php.


The documentation for this class was generated from the following file: