kartik-v / yii2-password

Useful password strength validation utilities for Yii Framework 2.0
http://demos.krajee.com/password
Other
75 stars 46 forks source link

Missing translations for a language keep spamming error log #57

Closed jurchiks closed 6 years ago

jurchiks commented 6 years ago

I get a TON of this error message in my error logs, which really makes it hard to find actual problems in the error log, since they drown in the sea of these:

The message file for category 'kvpwdstrength' does not exist: /var/www/{project-name}/vendor/kartik-v/yii2-password/messages/uk/kvpwdstrength.php

You don't have a Ukrainian translation, so the message is understandable, but the fact that it spams so much is not, which is why I'd like to use the Russian translation instead. How could I do this?

kartik-v commented 6 years ago

Best is if you could submit a Pull Request for Ukranian translation to be added to the extension.

Alternatively, you can set the language property for the widget to Russian.

jurchiks commented 6 years ago

Yeeah, I don't know any Ukrainian... Does that mean EVERY widget everywhere in the site has to have this property set?

jurchiks commented 6 years ago

Also, how exactly do you set the language property? I can't find any documentation for that and there is no reference to "lang" in the StrengthValidator class.

kartik-v commented 6 years ago

You can set it globally via your yii2 application config that will be automatically read by the widget (which is what you must be doing to set Ukranian).

Only if you need different language for the widget (different from your yii2 app language) - then you can use the widget's language property.

Since kartik\password\PasswordInput extends kartik\base\InputWidget you can refer the language property documented there.

jurchiks commented 6 years ago

That is what I need, since the frontend's language can be Ukrainian for the users. So there is no way to set your widget's language globally, so I don't have to change every place where your widget is used?

jurchiks commented 6 years ago

Obtained the translations, could you merge this? https://github.com/kartik-v/yii2-password/pull/58