jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/266582 )

Change subject: Add mw-content-ltr|rtl to file redirect pages
......................................................................


Add mw-content-ltr|rtl to file redirect pages

28ea73bc3a07a4588f1b5fde4f5c41522eaa9518 added NS_FILE to the list,
because most of the content is user language. That does not
really apply for #REDIRECT, however.

As a side effect, this also makes the redirect arrows visible on File
redirect pages, because their CSS depends on these classes.

Another side effect is that now "additional" content will show for the
redirect as reported broken in T29857.

Bug: T60955
Change-Id: I6b14c17a4b74ff5964ea61554aa3afb197d206bf
---
M includes/skins/SkinTemplate.php
1 file changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Fomafix: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index bf260aa..c3e3cea 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -269,11 +269,13 @@
                # An ID that includes the actual body text; without categories, 
contentSub, ...
                $realBodyAttribs = [ 'id' => 'mw-content-text' ];
 
-               # Add a mw-content-ltr/rtl class to be able to style based on 
text direction
-               # when the content is different from the UI language, i.e.:
-               # not for special pages or file pages AND only when viewing
-               if ( !in_array( $title->getNamespace(), [ NS_SPECIAL, NS_FILE ] 
) &&
-                       Action::getActionName( $this ) === 'view' ) {
+               # Add a mw-content-ltr/rtl class to be able to style based on 
text
+               # direction when the content is different from the UI language 
(only
+               # when viewing)
+               # Most information on special pages and file pages is in user 
language,
+               # rather than content language, so those will not get this
+               if ( Action::getActionName( $this ) === 'view' &&
+                       ( !$title->inNamespaces( NS_SPECIAL, NS_FILE ) || 
$title->isRedirect() ) ) {
                        $pageLang = $title->getPageViewLanguage();
                        $realBodyAttribs['lang'] = $pageLang->getHtmlCode();
                        $realBodyAttribs['dir'] = $pageLang->getDir();

-- 
To view, visit https://gerrit.wikimedia.org/r/266582
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b14c17a4b74ff5964ea61554aa3afb197d206bf
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>
Gerrit-Reviewer: Fomafix <[email protected]>
Gerrit-Reviewer: Isarra <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to