r91199 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91198‎ | r91199 | r91200 >
Date:19:00, 30 June 2011
Author:platonides
Status:ok
Tags:
Comment:
Rtl information was present in Rtl.php but unused.
Added isRTL() function and getDir(), based on homonym
methods of MediaWiki Language class.
Modified paths:
  • /trunk/tools/ToolserverI18N/TsIntuition.php (modified) (history)

Diff [purge]

Index: trunk/tools/ToolserverI18N/TsIntuition.php
@@ -1261,4 +1261,27 @@
12621262 echo "<br />\n";
12631263 }
12641264 }
 1265+
 1266+ /**
 1267+ * Returns true if a language is Right-to-left
 1268+ * @param $code String Language code to get the property from,
 1269+ * current language if missing
 1270+ * @return Boolean
 1271+ */
 1272+ function isRTL( $code = null ) {
 1273+ if ( !$code ) {
 1274+ $code = $this->getCode();
 1275+ }
 1276+ require __DIR__ . '/language/Rtl.php';
 1277+
 1278+ return in_array( $code, $rtlLanguages );
 1279+ }
 1280+
 1281+ /**
 1282+ * Return the correct HTML 'dir' attribute value for this language.
 1283+ * @return String
 1284+ */
 1285+ function getDir( $code = null ) {
 1286+ return $this->isRTL( $code ) ? 'rtl' : 'ltr';
 1287+ }
12651288 }

Sign-offs

UserFlagDate
Krinkleinspected23:20, 4 July 2011
Krinkletested23:20, 4 July 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r91200Fix r91199.platonides19:03, 30 June 2011
r91373follow-up r91199 + r91200:...jan15:20, 3 July 2011

Status & tagging log