From 7492c55ee8483762f8f1476e11d3713bdb995f7c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 27 Apr 2004 08:11:18 +0000 Subject: [PATCH] Hacking in some RTL support for MonoBook skin. Needs testing and fixes for some browsers... --- includes/Skin.php | 2 +- includes/SkinPHPTal.php | 2 + languages/LanguageHe.php | 10 ++- stylesheets/rtl.css | 159 +++++++++++++++++++++++++++++++++++++++ templates/xhtml_slim.pt | 7 +- 5 files changed, 175 insertions(+), 5 deletions(-) create mode 100644 stylesheets/rtl.css diff --git a/includes/Skin.php b/includes/Skin.php index 97997f5998..4399c4c6da 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1782,7 +1782,7 @@ class Skin { $magnifyalign = $wgLang->isRTL() ? "left" : "right"; $textalign = $wgLang->isRTL() ? ' style="text-align:right"' : ""; - $s = "
"; + $s = "
"; if ( $thumbUrl == "" ) { $s .= str_replace( "$1", $img->getName(), wfMsg("missingimage") ); $zoomicon = ''; diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index f87ddff8a5..e72a2ece49 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -117,6 +117,8 @@ $tpl->setRef( "stylepath", &$wgStyleSheetPath ); $tpl->setRef( "logopath", &$wgLogo ); $tpl->setRef( "lang", &$wgLanguageCode ); + $tpl->set( "dir", $wgLang->isRTL() ? "rtl" : "ltr" ); + $tpl->set( "rtl", $wgLang->isRTL() ); $tpl->set( "langname", $wgLang->getLanguageName( $wgLanguageCode ) ); $tpl->setRef( "username", &$this->username ); $tpl->setRef( "userpage", &$this->userpage); diff --git a/languages/LanguageHe.php b/languages/LanguageHe.php index c5eacc4ca5..9dec31706a 100644 --- a/languages/LanguageHe.php +++ b/languages/LanguageHe.php @@ -22,8 +22,12 @@ include_once("LanguageUtf8.php"); 7 => "שיחת_תמונה", 8 => "MediaWiki", 9 => "MediaWiki_talk", - 10 => "Template", - 11 => "Template_talk" + 10 => "Template", + 11 => "Template_talk", + 12 => "Help", + 13 => "Help_talk", + 14 => "Category", + 15 => "Category_talk", ); @@ -215,7 +219,7 @@ include_once("LanguageUtf8.php"); "retrievedfrom" => "מקור: $1", "newmessages" => "יש לך $1", "newmessageslink" => "הודעות חדשות", - +"editsection" => "עריכה", # Main script and global functions # diff --git a/stylesheets/rtl.css b/stylesheets/rtl.css new file mode 100644 index 0000000000..434c7ac70c --- /dev/null +++ b/stylesheets/rtl.css @@ -0,0 +1,159 @@ +/* +Right-to-left fixes for MonoBook. +Places sidebar on right, tweaks various alignment issues. + +Works mostly ok nicely on Safari 1.2.1; broken in Mozilla. +Not well tested on other browers yet. + +Safari bugs (1.2.1): +* Tabs are still appearing in left-to-right order. (Try after localizing) + +Mozilla bugs (Firefox 0.8): +* Tabs are LTR +* Tabs and personal links are missing their left/right borders/margins +* The boxes in the sidebar appear waaaaay off screen right on some pages +* Padding fixes on links-with-icons are not taking. + +Opera bugs (7.5 beta/mac): +* Tabs are horribly munged together +* The order of the individual letters is reversed in the tabs ("yrotsih") +* Some bits of text (sidebar box titles, username) have forward and backward versions overlapping each other +* Link icons don't move to the left side, end up overlapping text +* Sidebar boxes are pushed down below the content area + +IE/mac bugs: +* The thing barfs on Hebrew and Arabic anyway, so no point testing. + +To test: +* Opera +* IE +* etc + +*/ + +#portal-column-content { +/* margin: 0 0 0 -12.2em; */ + margin: 0; +} + +#portal-column-content #content{ + margin-left: 0; + margin-right: 12.2em; +} + +#documentContent { + border-right: 1px solid #aaaaaa; + border-left: none; +} + +/* Fix alignment */ +#catlinks, +.documentByLine, +.portletDetails, +.portletMore, +#portal-personaltools { + text-align: left; +} + +div div.thumbcaption { + text-align: right; +} + +#portal-column-content, +#catlinks, +div.magnify, +#div.townBox, +.portletClose { + float: left; +} + +#portlet-logo { + left: auto; + right: 0; +} +#portlet-personal { + left: auto; + right: 0; +} + +#portlet-contentViews { + left: auto; + right: 11.5em; +} + +/* Fix margins */ +/* top right bottom left */ + +ul { + margin-left: 0; + margin-right: 1.5em; +} +ol { + margin-left: 0; + margin-right: 2.4em; +} +dd { + margin-left: 0; + margin-right: 1.6em; +} +#documentSubtitle { + margin-right: 1em; + margin-left: 0; +} +.tocindent { + margin-left: 0; + margin-right: 2em; +} +div.townBox { + margin-left: 0; + margin-right: 1em; +} +div.townBox dl dd { + margin-left: 0; + margin-right: 1.1em; +} +#portal-personaltools li { + margin-left: 0; + margin-right: 1em; +} + +li#contentaction-talk, +li#contentaction-watch { + margin-right: auto; + margin-left: 1.6em; +} + + +/* Fix link icons */ +li#personaltools-userpage, +li#personaltools-anonuserpage, +li#personaltools-login { + background-position: right; + padding-left: 0; + padding-right: 20px; +} + +#bodyContent a[href ^="http://"], +#bodyContent a[href ^="gopher://"] { + background-position: left; + padding-right: 0; + padding-left: 13px; +} +#bodyContent a[href ^="https://"], +.link-https { + background-position: left; + padding-right: 0; + padding-right: 16px; +} +#bodyContent a[href ^="mailto:"], +.link-mailto, +#bodyContent a[href ^="news://"], +#bodyContent a[href ^="ftp://"], +.link-ftp, +#bodyContent a[href ^="irc://"], +.link-irc { + background-position: left; + padding-right: 0; + padding-right: 18px; +} + diff --git a/templates/xhtml_slim.pt b/templates/xhtml_slim.pt index c18a017509..0c84c072e1 100644 --- a/templates/xhtml_slim.pt +++ b/templates/xhtml_slim.pt @@ -1,6 +1,6 @@ - + ${headlinks} @@ -13,6 +13,11 @@ /* @import url(${stylepath}/custom.css); */ /*]]>*/ +