bitzesty / devise_zxcvbn

Devise plugin to reject weak passwords using zxcvbn
MIT License
194 stars 38 forks source link

use ActionView::Helpers::DateHelper for crack_time_display #42

Open finchi opened 3 years ago

finchi commented 3 years ago

Since crack_time_display gets passed as a I18n variable, it would be nice if it would be already translated with distance_of_time_in_words. Else it doesn't make sense to use it with other languages

formigarafa commented 3 years ago

@finchi This is a problem of the wrapped js library in one of the dependencies. The "good" part is that it is very stable so might be possible to make a parser to extract those strings form it and make them translatable, the bad part is it may be overly complicated compared to update the js library. Then, the worst part is that the original library (https://github.com/dropbox/zxcvbn) does not change since 2017 and it seems very unlikely to change. Also, maybe the gem this repo depend on is a bit too generic to assume distance_time_in_words would be available. But maybe if you sketch a little better what is your use-case and how this could be useful then maybe someone could try to help.