Skip to content

Commit

Permalink
Dev Translation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Feb 11, 2020
1 parent 8736469 commit 24f1fb8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 33 deletions.
2 changes: 1 addition & 1 deletion application/helpers/questionHelper.php
Expand Up @@ -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')
);

Expand Down
40 changes: 10 additions & 30 deletions application/models/User.php
Expand Up @@ -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);
}

Expand Down
Expand Up @@ -73,7 +73,7 @@
<!-- Use ExpressionScript Engine code-->
<div class="form-group row">
<label class="col-sm-12 control-label" for='emcode'>
<?php eT("Use Expression Engine code:"); ?>
<?php eT("Use ExpressionScript code:"); ?>
</label>
<div class='col-sm-12'>
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
Expand Down
Expand Up @@ -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 = '';
Expand Down

0 comments on commit 24f1fb8

Please sign in to comment.