Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2244,7 +2244,7 @@ |
2245 | 2245 | 'cols' => $this->getUser()->getOption( 'cols' ), |
2246 | 2246 | 'rows' => $this->getUser()->getOption( 'rows' ), |
2247 | 2247 | 'readonly' => 'readonly', |
2248 | | - 'lang' => $pageLang->getCode(), |
| 2248 | + 'lang' => $pageLang->getHtmlCode(), |
2249 | 2249 | 'dir' => $pageLang->getDir(), |
2250 | 2250 | ); |
2251 | 2251 | $this->addHTML( Html::element( 'textarea', $params, $source ) ); |
— | — | @@ -2381,7 +2381,7 @@ |
2382 | 2382 | $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' ); |
2383 | 2383 | } |
2384 | 2384 | |
2385 | | - $ret = Html::htmlHeader( array( 'lang' => $this->getLanguage()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) ); |
| 2385 | + $ret = Html::htmlHeader( array( 'lang' => $this->getLanguage()->getHtmlCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) ); |
2386 | 2386 | |
2387 | 2387 | if ( $this->getHTMLTitle() == '' ) { |
2388 | 2388 | $this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() ) ); |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -288,9 +288,9 @@ |
289 | 289 | $tpl->setRef( 'logopath', $wgLogo ); |
290 | 290 | $tpl->setRef( 'sitename', $wgSitename ); |
291 | 291 | |
292 | | - $contentlang = $wgContLang->getCode(); |
| 292 | + $contentlang = $wgContLang->getHtmlCode(); |
293 | 293 | $contentdir = $wgContLang->getDir(); |
294 | | - $userlang = $this->getLanguage()->getCode(); |
| 294 | + $userlang = $this->getLanguage()->getHtmlCode(); |
295 | 295 | $userdir = $this->getLanguage()->getDir(); |
296 | 296 | |
297 | 297 | $tpl->set( 'lang', $userlang ); |
— | — | @@ -420,7 +420,7 @@ |
421 | 421 | in_array( $request->getVal( 'action', 'view' ), array( 'view', 'historysubmit' ) ) && |
422 | 422 | ( $title->exists() || $title->getNamespace() == NS_MEDIAWIKI ) ) { |
423 | 423 | $pageLang = $title->getPageLanguage(); |
424 | | - $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), |
| 424 | + $realBodyAttribs = array( 'lang' => $pageLang->getHtmlCode(), 'dir' => $pageLang->getDir(), |
425 | 425 | 'class' => 'mw-content-'.$pageLang->getDir() ); |
426 | 426 | $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |
427 | 427 | } |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -775,7 +775,7 @@ |
776 | 776 | if ( $forContent ) { |
777 | 777 | $msg = $msgObj->inContentLanguage()->text(); |
778 | 778 | if ( $this->getLanguage()->getCode() !== $wgContLang->getCode() ) { |
779 | | - $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $msg ); |
| 779 | + $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $msg ); |
780 | 780 | } |
781 | 781 | return $msg; |
782 | 782 | } else { |
— | — | @@ -1392,7 +1392,7 @@ |
1393 | 1393 | } |
1394 | 1394 | |
1395 | 1395 | $notice = Html::rawElement( 'div', array( 'id' => 'localNotice', |
1396 | | - 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $notice ); |
| 1396 | + 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $notice ); |
1397 | 1397 | wfProfileOut( __METHOD__ ); |
1398 | 1398 | return $notice; |
1399 | 1399 | } |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -3450,6 +3450,14 @@ |
3451 | 3451 | } |
3452 | 3452 | |
3453 | 3453 | /** |
| 3454 | + * Get the code in Bcp47 format which we can use |
| 3455 | + * inside of html lang="" tags. |
| 3456 | + */ |
| 3457 | + function getHtmlCode() { |
| 3458 | + return wfBcp47( $this->getCode() ); |
| 3459 | + } |
| 3460 | + |
| 3461 | + /** |
3454 | 3462 | * @param $code string |
3455 | 3463 | */ |
3456 | 3464 | function setCode( $code ) { |