Skip to content

Commit 83b9040

Browse files
authored
feature #31 Add @ignore annotations for incomplete translation keys (evertharmeling)
This PR was merged into the 1.0-dev branch. Discussion ---------- | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT As some translation keys are dynamically build, they now are marked as `missing` when running `bin/console debug:translation en --only-missing` for example. Adding the `/** @ignore */` suppresses the marking. Commits ------- d4fa4fe Add @ignore annotations for incomplete translation keys
2 parents fe2ac6f + d4fa4fe commit 83b9040

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Validator/Constraints/PasswordStrengthValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ public function validate($password, Constraint $constraint)
107107
if ($passwordStrength < $constraint->minStrength) {
108108
$parameters = [
109109
'{{ length }}' => $constraint->minLength,
110-
'{{ min_strength }}' => $this->translator->trans('rollerworks_password.strength_level.'.self::$levelToLabel[$constraint->minStrength], [], 'validators'),
111-
'{{ current_strength }}' => $this->translator->trans('rollerworks_password.strength_level.'.self::$levelToLabel[$passwordStrength], [], 'validators'),
110+
'{{ min_strength }}' => $this->translator->trans(/** @Ignore */'rollerworks_password.strength_level.'.self::$levelToLabel[$constraint->minStrength], [], 'validators'),
111+
'{{ current_strength }}' => $this->translator->trans(/** @Ignore */'rollerworks_password.strength_level.'.self::$levelToLabel[$passwordStrength], [], 'validators'),
112112
'{{ strength_tips }}' => implode(', ', array_map([$this, 'translateTips'], $tips)),
113113
];
114114

@@ -123,7 +123,7 @@ public function validate($password, Constraint $constraint)
123123
*/
124124
public function translateTips($tip)
125125
{
126-
return $this->translator->trans('rollerworks_password.tip.'.$tip, [], 'validators');
126+
return $this->translator->trans(/** @Ignore */'rollerworks_password.tip.'.$tip, [], 'validators');
127127
}
128128

129129
private function calculateStrength($password, &$tips)

0 commit comments

Comments
 (0)