From 24f1fb85104dbc49ffc49a236e47021bb1507cb4 Mon Sep 17 00:00:00 2001 From: Carsten Schmitz Date: Tue, 11 Feb 2020 16:52:02 +0100 Subject: [PATCH] Dev Translation fixes --- application/helpers/questionHelper.php | 2 +- application/models/User.php | 40 +++++-------------- .../export/exportresult_panels/_headings.php | 2 +- .../subview/accordion/_tokens_panel.php | 2 +- 4 files changed, 13 insertions(+), 33 deletions(-) diff --git a/application/helpers/questionHelper.php b/application/helpers/questionHelper.php index ab665c06a10..04a3437cb05 100644 --- a/application/helpers/questionHelper.php +++ b/application/helpers/questionHelper.php @@ -182,7 +182,7 @@ public static function getAttributesDefinitions() "1"=>gT('Yes'), ), 'default' => "1", - 'help'=>gT('Use javascript function to remove text and uncheck checkbox (or use ExpressionScript Engine only).'), + 'help'=>gT('Use Javascript functions to remove text and uncheck checkbox (or use only ExpressionScript engine).'), 'caption'=>gT('Remove text or uncheck checkbox automatically') ); diff --git a/application/models/User.php b/application/models/User.php index fe0e58e69ac..aa7193b6c78 100644 --- a/application/models/User.php +++ b/application/models/User.php @@ -320,42 +320,22 @@ public function checkPasswordStrength($password){ } public function getPasswordHelpText(){ - $settings = Yii::app()->getConfig("passwordValidationRules"); - $txt = ''; - $txt2 = ''; - if((int) $settings['min'] > 0) $txt = sprintf(ngT('Password must be at least %d character long|Password must be at least %d characters long', $settings['min']), $settings['min']); - if((int) $settings['max'] > 0) $txt = sprintf(ngT('Password must be at most %d character long|Password must be at most %d characters long', $settings['max']), $settings['max']); + $settings = Yii::app()->getConfig("passwordValidationRules"); + $txt = gT('A password must meet the following requirements: '); + if((int) $settings['min'] > 0) $txt .= sprintf(ngT('At least %d character long.|At least %d characters long.', $settings['min']), $settings['min']).' '; + if((int) $settings['max'] > 0) $txt .= sprintf(ngT('At most %d character long.|At most %d characters long.', $settings['max']), $settings['max']).' '; if((int) $settings['min'] > 0 && (int) $settings['max'] > 0){ if($settings['min'] == $settings['max']){ - $txt = sprintf(ngT('Password must be exactly %d character in length|Password must be exactly %d characters in length', $settings['min']), $settings['min']); + $txt .= sprintf(ngT('Exactly %d character long.|Exactly %d characters long.', $settings['min']), $settings['min']).' '; } else if($settings['min'] < $settings['max']){ - $txt = sprintf(gT('Password must be between %d - %d characters in length'), $settings['min'], $settings['max']); + $txt .= sprintf(gT('Between %d - %d characters long.'), $settings['min'], $settings['max']).' '; } } - - $txt1 = array(); - if((int) $settings['lower'] > 0) $txt1[] = ' '.sprintf(ngT('%d lower case letter|%d lower case letters', $settings['lower']), $settings['lower']); - if((int) $settings['upper'] > 0) $txt1[] = ' '.sprintf(ngT('%d upper case letter|%d upper case letters', $settings['upper']), $settings['upper']); - if((int) $settings['numeric'] > 0) $txt1[] = ' '.sprintf(ngT('%d number|%d numbers', $settings['numeric']), $settings['numeric']); - if((int) $settings['symbol'] > 0) $txt1[] = ' '.sprintf(ngT('%d special character|%d special characters', $settings['symbol']), $settings['symbol']); - if(!empty($txt1)){ - foreach($txt1 as $i => $tmp){ - if($i == (count($txt1)-1)){ - if($txt2) $txt2 .= ' '.gT("and").' '; - } else { - if($txt2) $txt2 .= ", "; - } - $txt2 .= $tmp; - } - } - - if($txt && $txt2){ - $txt = $txt.' '. gT('and must include at least').' '.$txt2.'.'; - } else - if($txt2){ - $txt = gT('Password must include at least').' '.$txt2.'.'; - } + if((int) $settings['lower'] > 0) $txt .= sprintf(ngT('At least %d lower case letter.|At least %d lower case letters.', $settings['lower']), $settings['lower']).' '; + if((int) $settings['upper'] > 0) $txt .= sprintf(ngT('At least %d upper case letter.|At least %d upper case letters.', $settings['upper']), $settings['upper']).' '; + if((int) $settings['numeric'] > 0) $txt .= sprintf(ngT('At least %d number.|At least %d numbers.', $settings['numeric']), $settings['numeric']).' '; + if((int) $settings['symbol'] > 0) $txt .= sprintf(ngT('At least %d special character.|At least %d special characters.', $settings['symbol']), $settings['symbol']).' '; return($txt); } diff --git a/application/views/admin/export/exportresult_panels/_headings.php b/application/views/admin/export/exportresult_panels/_headings.php index f56d8bc5edd..c2c7e8c8ecb 100644 --- a/application/views/admin/export/exportresult_panels/_headings.php +++ b/application/views/admin/export/exportresult_panels/_headings.php @@ -73,7 +73,7 @@
widget('yiiwheels.widgets.switch.WhSwitch', array( diff --git a/application/views/admin/survey/subview/accordion/_tokens_panel.php b/application/views/admin/survey/subview/accordion/_tokens_panel.php index 78ac0046b1b..97012371d88 100755 --- a/application/views/admin/survey/subview/accordion/_tokens_panel.php +++ b/application/views/admin/survey/subview/accordion/_tokens_panel.php @@ -14,7 +14,7 @@ var sParameter = ''; var sTargetQuestion = ''; var sNoParametersDefined = ''; - var sAdminEmailAddressNeeded = '".gT("If you are using participants or notifications emails you need to set an administrator email address.",'js')."' + var sAdminEmailAddressNeeded = '".gT("If you are using participants or notification emails you need to set an administrator email address.",'js')."' var sURLParameters = ''; var sAddParam = '';