From 522514dabde171b04449bf9a5353f95719f567eb Mon Sep 17 00:00:00 2001 From: Raphael Schweikert Date: Sat, 12 Jan 2019 13:15:02 +0100 Subject: [PATCH] Log string params if string not found --- lib/model/TranslationPeer.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/model/TranslationPeer.php b/lib/model/TranslationPeer.php index d3a3a8062..c6d4dc34a 100644 --- a/lib/model/TranslationPeer.php +++ b/lib/model/TranslationPeer.php @@ -66,9 +66,6 @@ public static function getString($sKey, $sLanguageId=null, $sDefaultValue=null, if(Settings::getSetting('frontend', 'display_string_keys', false)) { return $sKey; } - if(!is_string($sDefaultValue)) { - $sDefaultValue = "Translation missing: $sKey"; - } if($sLanguageId === null) { $sLanguageId = Session::language(); } @@ -77,7 +74,18 @@ public static function getString($sKey, $sLanguageId=null, $sDefaultValue=null, if($oString === null) { $sString = self::getStaticString($sKey, $sLanguageId); if($sString === null) { - return $sDefaultValue; + if(!is_string($sDefaultValue)) { + $sDefaultValue = "Translation missing: $sKey"; + if(!empty($aParameters)) { + $sDefaultValue .= " ("; + foreach($aParameters as $sKey => $sValue) { + $sDefaultValue .= "$sKey: $sValue, "; + } + $sDefaultValue = substr($sDefaultValue, 0, -2); + $sDefaultValue .= ")"; + } + } + return $sDefaultValue; } } else { $sString = $oString->getText();