jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/382436 )
Change subject: Add lang attribute to languages in <languages>
......................................................................
Add lang attribute to languages in <languages>
The links to individual languages in the <languages /> tag from the page
translation feature should have lang attributes. This would make it easier to
e.g. apply CSS to certain languages.
Bug: T157510
Change-Id: Ieb13d758818a852a69654dc9a6b136d018cc8c59
---
M tag/PageTranslationHooks.php
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Nikerabbit: Looks good to me, approved
diff --git a/tag/PageTranslationHooks.php b/tag/PageTranslationHooks.php
index 614ceae..bbabb0f 100644
--- a/tag/PageTranslationHooks.php
+++ b/tag/PageTranslationHooks.php
@@ -267,7 +267,11 @@
if ( $currentTitle->equals( $subpage ) ) {
$classes[] = 'mw-pt-languages-selected';
$classes = array_merge( $classes,
self::tpProgressIcon( $percent ) );
- $name = Html::rawElement( 'span', [ 'class' =>
$classes ], $name );
+ $name = Html::rawElement(
+ 'span',
+ [ 'class' => $classes , 'lang' =>
wfBCP47( $code ) ],
+ $name
+ );
} elseif ( $subpage->isKnown() ) {
$pagename = $page->getPageDisplayTitle( $code );
if ( !is_string( $pagename ) ) {
@@ -284,6 +288,7 @@
$attribs = [
'title' => $title,
'class' => $classes,
+ 'lang' => wfBCP47( $code ),
];
$name = Linker::linkKnown( $subpage, $name,
$attribs );
--
To view, visit https://gerrit.wikimedia.org/r/382436
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb13d758818a852a69654dc9a6b136d018cc8c59
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Omidfi <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits