X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2FLanguage.php;h=d750f7d519a11f846ed7a6626e60e1444c047d46;hb=3d54d208bc0dd54baef18b3891ff0faf1d300214;hp=b71defa46fe8b81162384fae9bd1e1fa22a5c41b;hpb=302e19c143d55cca7e10e37f3bf72a886e52b1be;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index b71defa46f..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 ); } /**