Page MenuHomePhabricator

on he.wikivoyage TOC are on the left instead of right as you would expect in RTL wiki
Closed, ResolvedPublic

Details

Reference
bz46864

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:40 AM
bzimport set Reference to bz46864.

It's because of the TocTree extension, which adds floating to table of contents. It has special clauses for body.rtl, which can probably removed to let CSSJanus handle them automatically.

What about simply removing the extension, which has no aesthetic value at all anyway?

(In reply to comment #2)

What about simply removing the extension, which has no aesthetic value at all
anyway?

I think it makes sense.

At the old Wikivoyage we could not test the extension for RTL languages. But the TOC behavior is realized only by CSS statements. I will look for additional styles.

I tested today better style sheet rules at he.wikivoyage:
(see http://he.wikivoyage.org/wiki/%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:RolandUnger/common.css)

/* Switching body.rtl properties off by setting to defaults */

body.rtl #toc .tocUl, body.ltr #toc .tocUl {
padding-left: 2em;
}

body.rtl .toggleNode, body.ltr .toggleNode {
left: -2em;
}

body.rtl #toc.tocFloat, body.ltr #toc.tocFloat {
float: left;
margin: 0 2em 1em 0;
}

/* New rules */

body.rtl.sitedir-rtl #toc.tocFloat {
float: right;
margin: 0 0 1em 2em;
}

After this, it was working well (most of the rules starting with body.rtl should be removed). This means only changing /toctree/modules/ext.toctree.css is necessary. Unfortunately I do not know how to make the corrections.

This is defined in CommonSettings.php…

    if ( $wmgUseTocTree ) {
            require_once( "$IP/extensions/TocTree/TocTree.php" );
	    $wgDefaultUserOptions['toc-floated'] = true;
    }

…as well as in InitialiseSettings.php:

    'wmgUseTocTree' => array(
	    'default' => false,
            'wikivoyage' => true,
    ),

However, I am not exactly sure what is the purpose of this extension. Of course, it provides the wiki with the tree option in their TOC, but do we actually need it at all?

The default properties for the Table of Contents properties can be changed to be switched off. Normally we proposed to have them switched off (This is the extension's default).

// default user options [from TocTree.php]
$wgDefaultUserOptions['toc-floated'] = false;
$wgDefaultUserOptions['toc-expand'] = false;

But the strong English community wanted to switch 'toc-floated' on. And all language branches must have the same default values (I think so). If you like to change it please discuss this problem with the English community.

Does this extension seriously add two preferences? Please just disable it on he.voy....

So I can see three ways out of this problem:

  1. Disable the extension on he.wikivoyage;
  2. Set $wgDefaultUserOptions['toc-floated'] = false on he.wikivoyage;
  3. Commit a change to TocTree/modules/ext.toctree.css.

Option 3 is preffered here (fix it if it's broken, not just disable it).

@Roland: To fix that, you'd only need to install git & create an account on our Gerrit instance; there are some good instructions at:

Or, if this is too much hassle for you, just submit a patch here and I'll commit it.

Related URL: https://gerrit.wikimedia.org/r/61051 (Gerrit Change Id4549ccb9c8153d0ac62563facf90149996acfb9)

I removed the RTL-specific rules in this commit:
https://gerrit.wikimedia.org/r/#/c/61051/

It seems like CSSJanus does the right thing without them.

Related URL: https://gerrit.wikimedia.org/r/61058 (Gerrit Change I71d31ddc5be4a4b9dd47c0d0bd1404de7c8d7b77)

I disabled the user option 'toc-floated' by default on hewikivoyage in this commit:
https://gerrit.wikimedia.org/r/61058/6

(In reply to comment #14)

I disabled the user option 'toc-floated' by default on hewikivoyage in this
commit:
https://gerrit.wikimedia.org/r/61058/6

Wrong URL. It should have been the following URL:
https://gerrit.wikimedia.org/r/#/c/61058/6

Css change has been merged. Perhaps reedy can decide whether or not to deploy the configuration change.

(In reply to comment #16)

Css change has been merged. Perhaps reedy can decide whether or not to deploy
the configuration change.

Is Amirs fix sufficient? Is it still needed/wanted? I will merge it if it is still needed/wanted.

According to my testing it is sufficient and needed.

Change 61058 merged by jenkins-bot:
Disable 'toc-floated' user option on hevoy

https://gerrit.wikimedia.org/r/61058

Change 90935 had a related patch set uploaded by Reedy:
Revert site specific config change to hewikivoyage

https://gerrit.wikimedia.org/r/90935

Change 90935 merged by jenkins-bot:
Revert site specific config change to hewikivoyage

https://gerrit.wikimedia.org/r/90935

(This is RESOLVED FIXED; Amir's patch should do the trick even without the config change.)