aboutsummaryrefslogtreecommitdiffstats
path: root/util/po2php.php
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-05-21 19:24:24 +1000
committerRedMatrix <info@friendica.com>2014-05-21 19:24:24 +1000
commit3e75f9cbb1c74cb140f07b92627101d774724a80 (patch)
treea80b1d1cd1e46a243e2afe3922c85214a2a9f1de /util/po2php.php
parent77ca117218382b57e2d0590466d9fc38dc016e80 (diff)
parentd15e3776f3ec5476b1614f0488e8e81e0f0ebb70 (diff)
downloadvolse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.tar.gz
volse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.tar.bz2
volse-hubzilla-3e75f9cbb1c74cb140f07b92627101d774724a80.zip
Merge pull request #464 from solstag/master
Bunch of translation work
Diffstat (limited to 'util/po2php.php')
-rw-r--r--util/po2php.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/util/po2php.php b/util/po2php.php
index edb1a35a8..d3e6d190c 100644
--- a/util/po2php.php
+++ b/util/po2php.php
@@ -30,6 +30,7 @@ function po2php_run($argv, $argc) {
$infile = file($pofile);
$k="";
$v="";
+ $ctx="";
$arr = False;
$ink = False;
$inv = False;
@@ -92,23 +93,27 @@ function po2php_run($argv, $argc) {
if ($k!="") $out .= $arr?");\n":";\n";
$arr=False;
$k = str_replace("msgid ","",$l);
- if ($k != '""' ) {
- $k = trim($k,"\"\r\n");
- } else {
- $k = "";
- }
-
+ $k = trim($k,"\"\r\n");
+ $k = $ctx.$k;
+ // echo $ctx ? $ctx."\nX\n":"";
$k = preg_replace_callback($escape_s_exp,'escape_s',$k);
+ $ctx = "";
$ink = True;
}
- if ($inv && substr($l,0,6)!="msgstr") {
+ if ($inv && substr($l,0,6)!="msgstr" && substr($l,0,7)!="msgctxt") {
$v .= trim($l,"\"\r\n");
$v = preg_replace_callback($escape_s_exp,'escape_s',$v);
//$out .= '$a->strings['.$k.'] = ';
}
-
-
+
+ if (substr($l,0,7)=="msgctxt") {
+ $ctx = str_replace("msgctxt ","",$l);
+ $ctx = trim($ctx,"\"\r\n");
+ $ctx = "__ctx:".$ctx."__ ";
+ $ctx = preg_replace_callback($escape_s_exp,'escape_s',$ctx);
+ }
+
}
if ($inv) { $inv = False; $out .= '"'.$v.'"'; }