Skip to content

Commit

Permalink
feature #31 Add @ignore annotations for incomplete translation keys (…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
sstok authored Dec 1, 2019
2 parents fe2ac6f + d4fa4fe commit 83b9040
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Validator/Constraints/PasswordStrengthValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public function validate($password, Constraint $constraint)
if ($passwordStrength < $constraint->minStrength) {
$parameters = [
'{{ length }}' => $constraint->minLength,
'{{ min_strength }}' => $this->translator->trans('rollerworks_password.strength_level.'.self::$levelToLabel[$constraint->minStrength], [], 'validators'),
'{{ current_strength }}' => $this->translator->trans('rollerworks_password.strength_level.'.self::$levelToLabel[$passwordStrength], [], 'validators'),
'{{ min_strength }}' => $this->translator->trans(/** @Ignore */'rollerworks_password.strength_level.'.self::$levelToLabel[$constraint->minStrength], [], 'validators'),
'{{ current_strength }}' => $this->translator->trans(/** @Ignore */'rollerworks_password.strength_level.'.self::$levelToLabel[$passwordStrength], [], 'validators'),
'{{ strength_tips }}' => implode(', ', array_map([$this, 'translateTips'], $tips)),
];

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

private function calculateStrength($password, &$tips)
Expand Down

0 comments on commit 83b9040

Please sign in to comment.