/* private */ function headElement()
{
- global $wgDocType, $wgDTD, $wgUser, $wgLanguageCode, $wgOutputEncoding;
+ global $wgDocType, $wgDTD, $wgUser, $wgLanguageCode, $wgOutputEncoding, $wgLang;
$ret = "<!DOCTYPE HTML PUBLIC \"$wgDocType\"\n \"$wgDTD\">\n";
if ( "" == $this->mHTMLtitle ) {
$this->mHTMLtitle = $this->mPagetitle;
}
- $ret .= "<html lang=\"$wgLanguageCode\"><head><title>{$this->mHTMLtitle}</title>\n";
+ $rtl = $wgLang->isRTL() ? " dir='RTL'" : "";
+ $ret .= "<html lang=\"$wgLanguageCode\"$rtl><head><title>{$this->mHTMLtitle}</title>\n";
array_push( $this->mMetatags, array( "http:Content-type", "text/html; charset={$wgOutputEncoding}" ) );
foreach ( $this->mMetatags as $tag ) {
if ( 0 == strcasecmp( "http:", substr( $tag[0], 0, 5 ) ) ) {
}
return $text;
}
+
+ # For right-to-left language support
+ function isRTL() { return false; }
}
global $IP;
@include_once( "{$IP}/Language" . ucfirst( $wgLanguageCode ) . ".php" );
?>
+v
\ No newline at end of file
--- /dev/null
+<?
+# See language.doc
+include_once("Utf8Case.php");
+
+class LanguageAr extends LanguageUtf8 {
+ # Inherit everything
+
+ # TODO: right-to-left support functions...?
+ function isRTL() { return true; }
+
+ # There may be a partial translation; get this merged in.
+
+ function checkTitleEncoding( $s ) {
+ global $wgInputEncoding;
+
+ # Check for non-UTF-8 URLs; assume they are windows-1256?
+ $ishigh = preg_match( '/[\x80-\xff]/', $s);
+ $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
+ '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
+
+ if( $ishigh and !$isutf )
+ return iconv( "windows-1256", "utf-8", $s );
+
+ return $s;
+ }
+
+}
+
+?>
--- /dev/null
+<?
+# See language.doc
+include_once("Utf8Case.php");
+
+class LanguageHe extends LanguageUtf8 {
+ # Inherit everything
+
+ # TODO: right-to-left support functions...?
+ function isRTL() { return true; }
+
+ # There may be a partial translation; get this merged in.
+
+ function checkTitleEncoding( $s ) {
+ global $wgInputEncoding;
+
+ # Check for non-UTF-8 URLs; assume they are 8859-8?
+ $ishigh = preg_match( '/[\x80-\xff]/', $s);
+ $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
+ '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
+
+ if( $ishigh and !$isutf )
+ return iconv( "iso8859-8", "utf-8", $s );
+
+ return $s;
+ }
+
+}
+
+?>