X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2FLanguage.php;h=d750f7d519a11f846ed7a6626e60e1444c047d46;hb=cc69954a9df31b3c31d72074ec84c0a0d9464e29;hp=fc8ef87c647ecef7840f235e4d3fc915bed9293b;hpb=3bfcc2a9fe52f045206f465363ac1ba6a843ba69;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index fc8ef87c64..d750f7d519 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -4148,6 +4148,18 @@ class Language { return $this->mConverter; } + /** + * convert text to a variant + * + * @param string $text text to convert + * @param string|bool $variant variant to convert to, or false to use the user's preferred + * variant (if logged in), or the project default variant + * @return string the converted string + */ + public function autoConvert( $text, $variant = false ) { + return $this->mConverter->autoConvert( $text, $variant ); + } + /** * convert text to all supported variants * @@ -4181,11 +4193,13 @@ class Language { /** * Convert a namespace index to a string in the preferred variant * - * @param int $ns - * @return string + * @param int $ns namespace index (https://www.mediawiki.org/wiki/Manual:Namespace) + * @param string|null $variant variant to convert to, or null to use the user's preferred + * variant (if logged in), or the project default variant + * @return string a string representation of the namespace */ - public function convertNamespace( $ns ) { - return $this->mConverter->convertNamespace( $ns ); + public function convertNamespace( $ns, $variant = null ) { + return $this->mConverter->convertNamespace( $ns, $variant ); } /** @@ -4822,7 +4836,7 @@ class Language { * @param string $details HTML safe text between brackets * @param bool $oppositedm Add the direction mark opposite to your * language, to display text properly - * @return HTML escaped string + * @return string HTML escaped */ function specialList( $page, $details, $oppositedm = true ) { if ( !$details ) {