Index: trunk/tools/ToolserverI18N/TsIntuition.php |
— | — | @@ -1261,4 +1261,27 @@ |
1262 | 1262 | echo "<br />\n"; |
1263 | 1263 | } |
1264 | 1264 | } |
| 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 | + } |
1265 | 1288 | } |