From 905374c86ef78dd6a2c1f7e37b6d290428e6259e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 19 Jun 2016 21:10:57 -0700 Subject: experimental rtl support; this will probably require a fair bit of work. --- boot.php | 7 +++++++ util/po2php.php | 12 ++++++++++-- view/php/default.php | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index 764e81292..6cf92d577 100755 --- a/boot.php +++ b/boot.php @@ -771,6 +771,7 @@ class App { public static $groups; public static $language; public static $langsave; + public static $rtl = false; public static $plugins_admin; public static $module_loaded = false; public static $query_string; @@ -2282,6 +2283,12 @@ function construct_page(&$a) { $page = App::$page; $profile = App::$profile; + // There's some experimental support for right-to-left text in the view/php/default.php page template. + // In v1.9 we started providing direction preference in the per language hstrings.php file + // This requires somebody with fluency in a RTL language to make happen + + $page['direction'] = 0; // ((App::$rtl) ? 1 : 0); + header("Content-type: text/html; charset=utf-8"); // security headers - see https://securityheaders.io diff --git a/util/po2php.php b/util/po2php.php index ab8c495f9..a72a65ba1 100644 --- a/util/po2php.php +++ b/util/po2php.php @@ -3,14 +3,21 @@ function po2php_run($argc,$argv) { - if ($argc!=2) { + if ($argc < 2) { print "Usage: ".$argv[0]." \n\n"; return; } - + + $rtl = false; + $pofile = $argv[1]; $outfile = dirname($pofile)."/hstrings.php"; + if($argc > 2) { + if($argv[2] === 'rtl') + $rtl = true; + } + if(strstr($outfile,'util')) $lang = 'en'; else @@ -53,6 +60,7 @@ function po2php_run($argc,$argv) { $out .= ' return '.$cond.';'."\n"; $out .= '}}'."\n"; } + $out .= 'App::$rtl = ' . intval($rtl) . ';'; if ($k!="" && substr($l,0,7)=="msgstr "){ if ($ink) { $ink = False; $out .= 'App::$strings["'.$k.'"] = '; } diff --git a/view/php/default.php b/view/php/default.php index ad6b7a3d1..f5be4fa35 100644 --- a/view/php/default.php +++ b/view/php/default.php @@ -5,7 +5,7 @@ - + >
-- cgit v1.2.3