Page MenuHomePhabricator

User tool bar is reversed on Arabic (ar) Wikipedia
Closed, ResolvedPublic

Description

Steps to reproduce:
1-Login to Arabic (ar) Wikipedia and use Arabic as your language in your preferences.
2-Enable Content Translation in Beta features.
3-Go to this link.

Observation (See attached screenshot):

  • The user tools bar (that contains links to user page, talk page, sandbox page, preferences, etc) at the top of the page is reversed. The link to user page is on the left and the link to log out is on the right. It should be the other way round. (Link to user page on the right and link to log out on the left.) This is because Arabic is an RTL language.
  • Compare with the normal Special:Contributions to see the difference.

Google Chrome 43 under Windows 8.

Event Timeline

Meno25 created this task.Jul 13 2015, 1:05 PM
Meno25 raised the priority of this task from to Needs Triage.
Meno25 updated the task description. (Show Details)
Meno25 added a project: ContentTranslation.
Meno25 added a subscriber: Meno25.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 13 2015, 1:05 PM

I can reproduce this.

The default skin template does not reverse the items in the toolbar. (SkinTemplate.php)

/**
	 * Get the HTML for the p-personal list
	 * @return string
	 */
	public function getPersonalToolsList() {
		$tpl = $this->setupTemplateForOutput();
		$tpl->set( 'personal_urls', $this->buildPersonalUrls() );
		$html = '';
		foreach ( $tpl->getPersonalTools() as $key => $item ) {
			$html .= $tpl->makeListItem( $key, $item );
		}
		return $html;
	}

Vector skin internally does this.
From VectorTemplate.php

// Reverse horizontally rendered navigation elements
		if ( $this->data['rtl'] ) {
			$this->data['view_urls'] =
				array_reverse( $this->data['view_urls'] );
			$this->data['namespace_urls'] =
				array_reverse( $this->data['namespace_urls'] );
			$this->data['personal_urls'] =
				array_reverse( $this->data['personal_urls'] );
		}

So to fix this, CX need to do same thing that vector does, but CX does not use Vector skin output.
If we want to do this inside Special:CX, we need access to SkinTemplate from $skin, I dont see it is exposed from $skin.

@Nikerabbit, any suggestions?

santhosh triaged this task as Normal priority.Jul 14 2015, 3:58 PM

Change 225237 had a related patch set uploaded (by Nikerabbit):
User tool bar is reversed on Arabic (ar) Wikipedia

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

Amire80 closed this task as Resolved.Jul 17 2015, 4:22 AM
Amire80 edited projects, added Wikimania-Hackathon-2015; removed Patch-For-Review.
Amire80 set Security to None.
Amire80 added a project: RTL.
Restricted Application added a project: I18n. · View Herald TranscriptJul 17 2015, 4:22 AM

Change 225237 merged by jenkins-bot:
User tool bar is reversed on Arabic (ar) Wikipedia

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