2amigos / yii2-date-picker-widget

Bootstrap DatePicker Widget for Yii2
https://2amigos.us
Other
130 stars 77 forks source link

Update language settings #2

Closed mickgeek closed 9 years ago

mickgeek commented 10 years ago

With an empty language property value these changes are automatically assigned to the picker the current application language. I think this is a good solution for multilingual systems. Also, if specify a full code (eg ru-RU), the picker will first check for an ru-RU language and if not found will check for a ru language.

tonydspaniard commented 10 years ago

@mickgeek Thank you for this pull request, but I think it should be left to the coder to specify the language, don't you agree? I think is kind of hacky this way and also the requirement to scan the the language dir previous rendering slows down the performance of the widget.

mickgeek commented 10 years ago

I don't think that scanning the directory with fifty lightweight files very slows down the performance. But I agree, this solution is not the best. If language translations would be merged into one file (as in the yii\jui\DatePicker widget), for a full locale code will be checked two language options (if first is not found), according to the picker documentation.

And please tell me whether there is a simple way to change the correct language depending on the language property in the application (eg ru-RU)?

tonydspaniard commented 9 years ago

The way is stated is just a matter to set its language attribute.