+ // Browsers are supposed to use BCP 47 standard in the
+ // Accept-Language header, but not all of our internal
+ // mediawiki variant codes are BCP 47. Map BCP 47 code
+ // to our internal code.
+ foreach ( $this->mVariants as $v ) {
+ // Case-insensitive match (BCP 47 is mixed case)
+ if ( strtolower( LanguageCode::bcp47( $v ) ) === $variant ) {
+ return $v;
+ }
+ }