jenkins-bot has submitted this change and it was merged.
Change subject: Use getHtmlCode() instead of getCode() to set the lang attribute
......................................................................
Use getHtmlCode() instead of getCode() to set the lang attribute
The lang attribute of HTML elements should conform to BCP 47.
Bug: 72939
Change-Id: I9b4a734753af2c9dd7256eec60781553bc76edbf
---
M includes/CategoryViewer.php
M includes/EditPage.php
M includes/logging/LogEventsList.php
M includes/specials/SpecialNewimages.php
M includes/specials/SpecialVersion.php
5 files changed, 6 insertions(+), 6 deletions(-)
Approvals:
Nikerabbit: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index 7581ae4..f68da95 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -136,7 +136,7 @@
}
$lang = $this->getLanguage();
- $langAttribs = array( 'lang' => $lang->getCode(), 'dir' =>
$lang->getDir() );
+ $langAttribs = array( 'lang' => $lang->getHtmlCode(), 'dir' =>
$lang->getDir() );
# put a div around the headings which are in the user language
$r = Html::openElement( 'div', $langAttribs ) . $r . '</div>';
@@ -515,7 +515,7 @@
}
$pageLang = $this->title->getPageLanguage();
- $attribs = array( 'lang' => $pageLang->getCode(), 'dir' =>
$pageLang->getDir(),
+ $attribs = array( 'lang' => $pageLang->getHtmlCode(), 'dir' =>
$pageLang->getDir(),
'class' => 'mw-content-' . $pageLang->getDir() );
$list = Html::rawElement( 'div', $attribs, $list );
diff --git a/includes/EditPage.php b/includes/EditPage.php
index fa19c78..d106da2 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2956,7 +2956,7 @@
);
$pageLang = $this->mTitle->getPageLanguage();
- $attribs['lang'] = $pageLang->getCode();
+ $attribs['lang'] = $pageLang->getHtmlCode();
$attribs['dir'] = $pageLang->getDir();
$wgOut->addHTML( Html::textarea( $name, $wikitext, $attribs ) );
diff --git a/includes/logging/LogEventsList.php
b/includes/logging/LogEventsList.php
index 8421672..5d11f84 100644
--- a/includes/logging/LogEventsList.php
+++ b/includes/logging/LogEventsList.php
@@ -557,7 +557,7 @@
if ( $logBody ) {
if ( $msgKey[0] ) {
$dir = $context->getLanguage()->getDir();
- $lang = $context->getLanguage()->getCode();
+ $lang = $context->getLanguage()->getHtmlCode();
$s = Xml::openElement( 'div', array(
'class' => "mw-warning-with-logexcerpt
mw-content-$dir",
diff --git a/includes/specials/SpecialNewimages.php
b/includes/specials/SpecialNewimages.php
index b9d1872..bc16925 100644
--- a/includes/specials/SpecialNewimages.php
+++ b/includes/specials/SpecialNewimages.php
@@ -59,7 +59,7 @@
if ( !$message->isDisabled() ) {
$this->getOutput()->addWikiText(
Html::rawElement( 'p',
- array( 'lang' =>
$wgContLang->getCode(), 'dir' => $wgContLang->getDir() ),
+ array( 'lang' =>
$wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ),
"\n" . $message->plain() . "\n"
),
/* $lineStart */ false,
diff --git a/includes/specials/SpecialVersion.php
b/includes/specials/SpecialVersion.php
index 6b9173f..5be3bc5 100644
--- a/includes/specials/SpecialVersion.php
+++ b/includes/specials/SpecialVersion.php
@@ -1203,7 +1203,7 @@
$language = $this->getLanguage();
$thAttribures = array(
'dir' => $language->getDir(),
- 'lang' => $language->getCode()
+ 'lang' => $language->getHtmlCode()
);
$out = Html::element(
'h2',
--
To view, visit https://gerrit.wikimedia.org/r/170890
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9b4a734753af2c9dd7256eec60781553bc76edbf
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Fomafix
Gerrit-Reviewer: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Tpt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits