diff options
author | Wave <wave72@users.noreply.github.com> | 2016-07-22 10:55:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-22 10:55:02 +0200 |
commit | 744ad84714fe0f7a3d90250a4ff02dc4327b9061 (patch) | |
tree | 595fb74ec9ea0bc7130d18bd7993d719a222d343 /util/po2php.php | |
parent | c38c79d71c8ef70ef649f83e322f1984b75ee2dd (diff) | |
parent | 7d897a3f03bd57ed556433eb84a41963ba44e02e (diff) | |
download | volse-hubzilla-744ad84714fe0f7a3d90250a4ff02dc4327b9061.tar.gz volse-hubzilla-744ad84714fe0f7a3d90250a4ff02dc4327b9061.tar.bz2 volse-hubzilla-744ad84714fe0f7a3d90250a4ff02dc4327b9061.zip |
Merge pull request #6 from redmatrix/dev
Dev
Diffstat (limited to 'util/po2php.php')
-rw-r--r-- | util/po2php.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/util/po2php.php b/util/po2php.php index 66807083b..a72a65ba1 100644 --- a/util/po2php.php +++ b/util/po2php.php @@ -1,16 +1,23 @@ <?php -function po2php_run($argv, $argc) { +function po2php_run($argc,$argv) { - if ($argc!=2) { + if ($argc < 2) { print "Usage: ".$argv[0]." <file.po>\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($argv, $argc) { $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.'"] = '; } @@ -140,5 +148,5 @@ function trim_message($str) { } if (array_search(__file__,get_included_files())===0){ - po2php_run($argv,$argc); + po2php_run($argc,$argv); } |