rollerworks / PasswordStrengthBundle

Symfony Password strength and blacklisting validator bundle
MIT License
142 stars 26 forks source link

I18N integration ? #27

Closed soullivaneuh closed 8 years ago

soullivaneuh commented 10 years ago

It would be useful to integrate translations on this bundle.

With this way, contributors could propose some default translations. :+1:

What do you think ? I can work on a PR if you want it.

Thanks.

sstok commented 10 years ago

Yes please, PasswordStrength is problematic because the configured strength also requires a correct message. Which was also why I did not include any translations in the beginning :)

Weak only requires a-z or A-Z, but very strong requires approximately a-z, A-Z, 0-9 and special chars to fill this requirement.

soullivaneuh commented 10 years ago

So you want a specific error message per strength level set on the PasswordStrength constraint ?

sstok commented 10 years ago

Sorry for the late reply.

Yes, the PasswordStrength constraint works with strength levels, but I'm not sure what combinations actually results in what level :) so its hard to tell if minimum strength level 3 would require at least something like a-z0-9-[!@#$%^&*()_+] or just [a-z0-9]. Also using more characters also increases the strength level. So having weak level with a big amount of characters would upgrade it to strong.

So using generic messages are problematic.

Thinking about the characters count, using more then 20 chars should also increase the strength level (if there not just repeating).

sstok commented 9 years ago

With the merging of #47 I may have some ideas to make this possible :)

If the strength is to low we can check what is missing, and include this in the message. Your password needs to be at least at strength level "{{ min_strength}}", current level is "{{ current_strength }}", try adding {{ strength_tips }}". which result in something like Your password needs to be at least at strength level "strong", current level is "weak"', try adding numbers and special chars.".

soullivaneuh commented 9 years ago

Seems good, why not!

Sorry for no news, quite busy at this moment.

sstok commented 8 years ago

Done in v1.5