Hacking in some RTL support for MonoBook skin. Needs testing and fixes for
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 27 Apr 2004 08:11:18 +0000 (08:11 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 27 Apr 2004 08:11:18 +0000 (08:11 +0000)
some browsers...

includes/Skin.php
includes/SkinPHPTal.php
languages/LanguageHe.php
stylesheets/rtl.css [new file with mode: 0644]
templates/xhtml_slim.pt

index 97997f5..4399c4c 100644 (file)
@@ -1782,7 +1782,7 @@ class Skin {
                $magnifyalign = $wgLang->isRTL() ? "left" : "right";
                $textalign = $wgLang->isRTL() ? ' style="text-align:right"' : "";
 
-               $s = "<div class=\"thumb t{$align}\"\"><div style=\"width:{$oboxwidth}px;\">";
+               $s = "<div class=\"thumb t{$align}\"><div style=\"width:{$oboxwidth}px;\">";
                if ( $thumbUrl == "" ) {
                        $s .= str_replace( "$1", $img->getName(), wfMsg("missingimage") );
                        $zoomicon = '';
index f87ddff..e72a2ec 100644 (file)
                        $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);
index c5eacc4..9dec317 100644 (file)
@@ -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 (file)
index 0000000..434c7ac
--- /dev/null
@@ -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;
+}
+
index c18a017..0c84c07 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}" lang="${lang}">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}" lang="${lang}" dir="${dir}">
   <head>
     <meta http-equiv="Content-Type" content="${mimetype}; charset=${charset}" />
        ${headlinks}
       /* @import url(${stylepath}/custom.css); */
       /*]]>*/
     </style>
+    <style tal:condition="rtl" type="text/css">
+      /*<![CDATA[*/
+      @import url(${stylepath}/rtl.css); */
+      /*]]>*/
+    </style>
     <link rel="stylesheet" type="text/css" media="print" href="${stylepath}/commonPrint.css" />
     <!--[if IE]><style type="text/css" media="all">@import url(${stylepath}/${skinname}/IEFixes.css);</style>
     <script type="text/javascript" src="${stylepath}/IEFixes.js"></script>