* (bug 3922) bidi embedding overrides on category links
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 24 Nov 2005 00:00:30 +0000 (00:00 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 24 Nov 2005 00:00:30 +0000 (00:00 +0000)
Based on gangleri's suggestion in http://bugzilla.wikimedia.org/show_bug.cgi?id=03922#c11

RELEASE-NOTES
includes/Skin.php

index 3760de6..cf8f4db 100644 (file)
@@ -245,6 +245,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 4020) Update namespaces for ms
 * (bug 2894) Enhanced Recent Changes link fixes
 * (bug 4059) fix 'hide minor edits' on Recentchangeslinked
+* (bug 3922) bidi embedding overrides on category links
 
 
 === Caveats ===
index 58b92cd..0fa5468 100644 (file)
@@ -421,15 +421,18 @@ END;
 
        function getCategoryLinks () {
                global $wgOut, $wgTitle, $wgParser;
-               global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgLang;
+               global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgContLang;
 
                if( !$wgUseCategoryMagic ) return '' ;
                if( count( $wgOut->mCategoryLinks ) == 0 ) return '';
 
-               # Taken out so that they will be displayed in previews -- TS
-               #if( !$wgOut->isArticle() ) return '';
-
-               $t = implode ( ' | ' , $wgOut->mCategoryLinks );
+               // Use Unicode bidi embedding override characters,
+               // to make sure links don't smash each other up in ugly ways.
+               // FIXME: should we use 'dir=emded' or something on links instead?
+               $embed = $wgContLang->isRTL() ? '&#x202b;' : '&#x202a;';
+               $pop = '&#x202c;';
+               $t = $embed . implode ( "$pop | $embed" , $wgOut->mCategoryLinks ) . $pop;
+               
                $msg = count( $wgOut->mCategoryLinks ) === 1 ? 'categories1' : 'categories';
                $s = $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Categories' ),
                        wfMsg( $msg ), 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )