[icinga-checkins] icinga.org: icingaweb2/feature/translation-catalog-statistics-object-13013 : CatalogEntry: Fix method isFaulty

git at icinga.org git at icinga.org
Mon Dec 12 13:06:19 CET 2016


Module: icingaweb2
Branch: feature/translation-catalog-statistics-object-13013
Commit: 4afd5f5499a20b98e1a419fc9ef7cc820c5f05a1
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=4afd5f5499a20b98e1a419fc9ef7cc820c5f05a1

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Mon Dec 12 12:58:37 2016 +0100

CatalogEntry: Fix method isFaulty

refs #13013

---

 .../translation/library/Translation/Catalog/CatalogEntry.php |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/translation/library/Translation/Catalog/CatalogEntry.php b/modules/translation/library/Translation/Catalog/CatalogEntry.php
index 576849f..f011a44 100644
--- a/modules/translation/library/Translation/Catalog/CatalogEntry.php
+++ b/modules/translation/library/Translation/Catalog/CatalogEntry.php
@@ -519,10 +519,14 @@ class CatalogEntry
     public function isFaulty()
     {
         $numberOfPlaceHoldersInId = substr_count($this->messageId, '%s');
+        if (! empty($this->message) && substr_count($this->message, '%s') !== $numberOfPlaceHoldersInId) {
+            return true;
+        }
 
-        if (! empty($this->messagePlurals)) {
-            foreach ($this->messagePlurals as $key => $value) {
-                if (substr_count($value, '%s') !== $numberOfPlaceHoldersInId) {
+        if (! empty($this->messageIdPlural)) {
+            $numberOfPlaceHoldersInPluralId = substr_count($this->messageIdPlural, '%s');
+            foreach ($this->messagePlurals as $value) {
+                if (substr_count($value, '%s') !== $numberOfPlaceHoldersInPluralId) {
                     return true;
                 }
             }



More information about the icinga-checkins mailing list