r90876 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90875‎ | r90876 | r90877 >
Date:14:04, 27 June 2011
Author:robin
Status:deferred
Tags:
Comment:
Correct alignment depending on the directionality of the language (assuming the definition and documentation are in English)
Modified paths:
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -643,8 +643,8 @@
644644
645645 $dialogID = $this->dialogID();
646646 $id = Sanitizer::escapeId( "def-$dialogID" );
647 - $msg = $this->adder( $id ) . "\n" . Html::rawElement( 'span',
648 - array( 'class' => 'mw-translate-edit-deftext' ),
 647+ $msg = $this->adder( $id ) . "\n" . Html::rawElement( 'div',
 648+ array( 'class' => 'mw-translate-edit-deftext', 'dir' => 'ltr', 'lang' => 'en' ),
649649 TranslateUtils::convertWhiteSpaceToHTML( $en )
650650 );
651651
@@ -749,7 +749,7 @@
750750 $params = array( 'class' => 'mw-translate-edit-item' );
751751
752752 $display = TranslateUtils::convertWhiteSpaceToHTML( $text );
753 - $display = Html::rawElement( 'span', array(
 753+ $display = Html::rawElement( 'div', array(
754754 'lang' => $fbcode,
755755 'dir' => Language::factory( $fbcode )->getDir() ),
756756 $display
@@ -807,7 +807,8 @@
808808 $contents = preg_replace( '~^<([a-z]+)>(.*)</\1>$~us', '\2', $contents );
809809
810810 return TranslateUtils::fieldset(
811 - wfMsgHtml( 'translate-edit-information', $edit, $page ), $contents, array( 'class' => $class )
 811+ wfMsgHtml( 'translate-edit-information', $edit, $page ), Html::rawElement( 'span',
 812+ array( 'dir' => 'ltr', 'lang' => 'en' ), $contents ), array( 'class' => $class )
812813 );
813814
814815 }
@@ -1074,7 +1075,9 @@
10751076 $counter++;
10761077 $dialogID = $this->dialogID();
10771078 $id = Sanitizer::escapeId( "tmsug-$dialogID-$counter" );
1078 - $contents = TranslateUtils::convertWhiteSpaceToHTML( $text );
 1079+ $contents = Html::rawElement( 'div', array( 'lang' => $this->targetLanguage,
 1080+ 'dir' => Language::factory( $this->targetLanguage )->getDir() ),
 1081+ TranslateUtils::convertWhiteSpaceToHTML( $text ) );
10791082 $contents .= $this->wrapInsert( $id, $text );
10801083
10811084 return $this->adder( $id ) . "\n" . $contents;

Follow-up revisions

RevisionCommit summaryAuthorDate
r90973Follow-up r90876: should be 'div', otherwise 'dir' has no effectrobin15:48, 28 June 2011
r91102Fix r90876: English when there is documentation, otherwise $wgLang when it sh...robin20:12, 29 June 2011

Status & tagging log