Commit e0f20abd by Alexander Makarov

minor formatting fixes

parent d7783a3e
...@@ -204,15 +204,15 @@ class MessageController extends Controller ...@@ -204,15 +204,15 @@ class MessageController extends Controller
$todo[$message] = ''; $todo[$message] = '';
} }
ksort($translated); ksort($translated);
foreach ($translated as $message => $translation) { foreach ($translated as $message => $translation) {
if (!isset($merged[$message]) && !isset($todo[$message]) && !$removeUnused) { if (!isset($merged[$message]) && !isset($todo[$message]) && !$removeUnused) {
if (substr($translation, 0, 2) === '@@' && substr($translation, -2) === '@@') { if (substr($translation, 0, 2) === '@@' && substr($translation, -2) === '@@') {
$todo[$message] = $translation; $todo[$message] = $translation;
} else { } else {
$todo[$message] = '@@' . $translation . '@@'; $todo[$message] = '@@' . $translation . '@@';
}
} }
} }
}
$merged = array_merge($todo, $merged); $merged = array_merge($todo, $merged);
if ($sort) { if ($sort) {
ksort($merged); ksort($merged);
...@@ -220,15 +220,15 @@ class MessageController extends Controller ...@@ -220,15 +220,15 @@ class MessageController extends Controller
if (false === $overwrite) { if (false === $overwrite) {
$fileName .= '.merged'; $fileName .= '.merged';
} }
if($format === 'po'){ if ($format === 'po'){
$out_str = ''; $out_str = '';
foreach($merged as $k=>$v){ foreach ($merged as $k => $v){
$k = preg_replace('/(\")|(\\\")/', "\\\"", $k); $k = preg_replace('/(\")|(\\\")/', "\\\"", $k);
$v = preg_replace('/(\")|(\\\")/', "\\\"", $v); $v = preg_replace('/(\")|(\\\")/', "\\\"", $v);
if(substr($v, 0, 2) === '@@' && substr($v, -2) === '@@'){ if (substr($v, 0, 2) === '@@' && substr($v, -2) === '@@') {
$out_str .= "#msgid \"$k\"\n"; $out_str .= "#msgid \"$k\"\n";
$out_str .= "#msgstr \"$v\"\n"; $out_str .= "#msgstr \"$v\"\n";
}else{ } else {
$out_str .= "msgid \"$k\"\n"; $out_str .= "msgid \"$k\"\n";
$out_str .= "msgstr \"$v\"\n"; $out_str .= "msgstr \"$v\"\n";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment