diff options
author | imoore76 <imoore76@users.noreply.github.com> | 2015-08-12 23:56:51 -0400 |
---|---|---|
committer | imoore76 <imoore76@users.noreply.github.com> | 2015-08-12 23:56:51 -0400 |
commit | a1172caa70fc60663bc0db62b643655497de3354 (patch) | |
tree | e79ec57bc7c291e5ae6f54954c441d26dc5b5698 /languages/source/parse_vbox_lang.php | |
parent | cd0f2520d9065c7ce8ced16fb1d1500245689227 (diff) | |
parent | 8b611cdf516d4449c186493b1b24a01760c4a9c8 (diff) | |
download | phpvirtualbox-a1172caa70fc60663bc0db62b643655497de3354.zip phpvirtualbox-a1172caa70fc60663bc0db62b643655497de3354.tar.gz phpvirtualbox-a1172caa70fc60663bc0db62b643655497de3354.tar.bz2 |
Merge pull request #4 from imoore76/develop
5.0-2
Diffstat (limited to 'languages/source/parse_vbox_lang.php')
-rw-r--r-- | languages/source/parse_vbox_lang.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/languages/source/parse_vbox_lang.php b/languages/source/parse_vbox_lang.php index 9af21a5..cb4ad93 100644 --- a/languages/source/parse_vbox_lang.php +++ b/languages/source/parse_vbox_lang.php @@ -39,6 +39,7 @@ foreach($arrXml['TS']['context'] as $c) { if(is_array($m['translation']) && count($m['translation']) == 0) continue; + // Translation is a numerusfourm if(is_array($m['translation']) && @$m['translation']['numerusform']) { if(!is_array($m['translation']['numerusform'])) { $m['translation'] = clean($m['translation']['numerusform']); @@ -48,11 +49,13 @@ foreach($arrXml['TS']['context'] as $c) { $m['translation']['numerusform'][$k] = clean($v); } } + // Translation exists } else if(is_array($m['translation'])) { // assume unfinished $m['translation'] = $s; + // Translation does not exist yet } else { $m['translation'] = clean($m['translation']); } @@ -68,13 +71,14 @@ foreach($arrXml['TS']['context'] as $c) { // Translation for this message exists if(isset($lang['contexts'][$c['name']]['messages'][$s]['translation'])) { - // Check to see if incoming translation has 'obsolete' + // Check to see if incoming translation has 'obsolete'. If so, don't copy it if(@$m['translation_attr']['type'] == 'obsolete') continue; - // Check to see if existing translation has 'obsolete' - if(@$lang['contexts'][$c['name']]['messages'][$s]['translation_attr']['type'] == 'obsolete') continue; - - $lang['contexts'][$c['name']]['messages'][$s] = array($lang['contexts'][$c['name']]['messages'][$s]); + // Check to see if existing translation has 'obsolete'. If so, overwrite it + if(@$lang['contexts'][$c['name']]['messages'][$s]['translation_attr']['type'] == 'obsolete') { + $lang['contexts'][$c['name']]['messages'][$s] = $m; + continue; + } } $lang['contexts'][$c['name']]['messages'][$s][] = $m; |