[icinga-checkins] icinga.org: icingaweb2/feature/po-file-parser-13011: CatalogParser: update

git at icinga.org git at icinga.org
Thu Nov 10 13:24:57 CET 2016


Module: icingaweb2
Branch: feature/po-file-parser-13011
Commit: 66997b0f51641acfa8c31a789e73ed42ce2ce07b
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=66997b0f51641acfa8c31a789e73ed42ce2ce07b

Author: Jennifer Mourek <jennifer.mourek at netways.de>
Date:   Thu Nov 10 13:24:34 2016 +0100

CatalogParser: update

---

 .../library/Translation/Catalog/CatalogParser.php      |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/translation/library/Translation/Catalog/CatalogParser.php b/modules/translation/library/Translation/Catalog/CatalogParser.php
index b8fac0e..8961d0e 100644
--- a/modules/translation/library/Translation/Catalog/CatalogParser.php
+++ b/modules/translation/library/Translation/Catalog/CatalogParser.php
@@ -127,7 +127,12 @@ class CatalogParser
                             break;
                         case 'flag':
                         case 'path':
-                            $currentEntry[$lastType] = array_merge($currentEntry[$lastType], $returnedValue['value']);
+                            if (isset($currentEntry[$lastType])) {
+                                $currentEntry[$lastType] = array_merge($currentEntry[$lastType], $returnedValue['value']);
+                            } else {
+                                $currentEntry[$lastType] = $returnedValue['value'];
+                            }
+
                             break;
                         default:
                             if (isset($currentEntry[$lastType])) {
@@ -193,6 +198,8 @@ class CatalogParser
                         }
                     }
                 }
+                $this->handleException($keyword . ' is not a valid keyword.');
+                return false;
         }
     }
 
@@ -334,12 +341,7 @@ class CatalogParser
      */
     protected function getNewEntryArray() {
         return array(
-            'obsolete'              => false,
-            'translator_comment'    => array(),
-            'extracted_comment'     => array(),
-            'flag'                  => array(),
-            'path'                  => array(),
-            'msgstr_plural'         => array()
+            'obsolete'              => false
         );
     }
 



More information about the icinga-checkins mailing list