]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
Add support for languages that read from right to left. language-rtl
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Dec 2012 17:21:33 +0000 (18:21 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Dec 2012 17:21:33 +0000 (18:21 +0100)
config/cfgroot/lang.pl
html/html/themes/ipfire/include/functions.pl

index 707b28d11e2b3c237c5c9cad072b20a705b50f34..7dbc4ec6c46ad2baa12ee25927b87bf123985e73 100644 (file)
@@ -157,4 +157,13 @@ sub BuildCacheLang {
     &General::log ("WARNING: cannot build cachelang file for [$missed].") if ($error);
     return $error;
 }
+
+sub RightToLeft() {
+       if ($language eq "fa") {
+               return 1;
+       }
+
+       return 0;
+}
+
 1;
index c681f804a76a7a415f84f6e32396801164ba9a6a..60ad6cbbcf003b57dc35d9fcfa9ca8461aad051e 100644 (file)
@@ -142,10 +142,18 @@ sub openpage {
         $title =  "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'} - $title"; 
     }
 
-    print <<END
+    print <<END;
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+END
 
-<html>
+       my $rtl = &Lang::RightToLeft();
+       if ($rtl > 0) {
+               print "<html dir=\"rtl\">";
+       } else {
+               print "<html>";
+       }
+
+       print <<END
   <head>
   <title>$title</title>