$req = $this->getURLVariant();
+ Hooks::run( 'GetLangPreferredVariant', [ &$req ] );
+
if ( $wgUser->isSafeToLoad() && $wgUser->isLoggedIn() && !$req ) {
$req = $this->getUserVariant();
} elseif ( !$req ) {
/**
* Get the variant specified in the URL
*
- * @return mixed Variant if one found, false otherwise.
+ * @return mixed Variant if one found, null otherwise
*/
public function getURLVariant() {
global $wgRequest;
/**
* Determine if the user has a variant set.
*
- * @return mixed Variant if one found, false otherwise.
+ * @return mixed Variant if one found, null otherwise
*/
protected function getUserVariant() {
global $wgUser, $wgContLang;
/**
* Determine the language variant from the Accept-Language header.
*
- * @return mixed Variant if one found, false otherwise.
+ * @return mixed Variant if one found, null otherwise
*/
protected function getHeaderVariant() {
global $wgRequest;
* Parse the conversion table stored in the cache.
*
* The tables should be in blocks of the following form:
- * -{
- * word => word ;
- * word => word ;
- * ...
- * }-
+ * -{
+ * word => word ;
+ * word => word ;
+ * ...
+ * }-
*
* To make the tables more manageable, subpages are allowed
* and will be parsed recursively if $recursive == true.