thamara / time-to-leave

Log work hours and get notified when it's time to leave the office and start to live.
http://timetoleave.app
GNU General Public License v3.0
463 stars 272 forks source link

Date picker is not localized according to selected language in user preferences/workday waiver window #949

Open timagixe opened 1 year ago

timagixe commented 1 year ago

Describe the issue Date picker always displays months in English version.

To Reproduce Steps to reproduce the behavior:

  1. Go to User preferences
  2. Change language to different from English
  3. Open date picker of Overall balance start date
  4. See that months of the date picker are not translated to the selected language

Expected behavior I believe date picker should also be localized to selected language

Environment

Screenshots

Screen Shot 2023-02-19 at 11 29 30 AM
tupaschoal commented 1 year ago

Nice find, it also needs updating in the workday waiver window

BikcromBiswas commented 1 year ago

Can you assign this is to me

tupaschoal commented 1 year ago

Sure

RahulKannan12 commented 1 year ago

I analysed this issue, findings below

  1. In the current logic , we are using default date picker which isn't supporting any localizations (AFAIK) .
  2. My proposal is to use jquery's datepicker from jquery-ui package, it's supporting localization Attached my codepen sample - https://codepen.io/pen?template=RweGWww

Let's discuss and move it further 👍

araujoarthur0 commented 1 year ago

@RahulKannan12 that looks cool. Can we also add theme support to it? Currently the datepicker is always white no matter the theme.

RahulKannan12 commented 1 year ago

@araujoarthur0 Thanks.

Yes, I did some checks, it is possible to add, Can some one assign this to me, I can start working on it ?

araujoarthur0 commented 1 year ago

@BikcromBiswas are you still working on this or is it ok to reassign?

BikcromBiswas commented 1 year ago

@BikcromBiswas are you still working on this or is it ok to reassign? Please reassign it

RahulKannan12 commented 1 year ago

@araujoarthur0 I've raised the PR for fixing the date picker localizations, unfortunately I couldn't add the theme support to it, as it requires some more understanding for me, I'll do it as part of my upcoming PR's.

soulflyman commented 1 year ago

No need to change the date picker code. By changing the localization with the --lang parameter as mentioned here https://github.com/thamara/time-to-leave/issues/10#issuecomment-1658033202, also changes the naming of the months in the date picker.

araujoarthur0 commented 1 year ago

That's rather interesting @soulflyman. Would you be willing to submit a PR for that? I wonder how we would communicate to users the need to restart the app to see the changes in the datepickers. Maybe a popup when closing the preferences if the language was changed.

soulflyman commented 1 year ago

I think a popup when closing or changing the language would be the best way.

I'm not familiar with electron development to create a pull request. It was accidentally that I discovered this option and thought this might help.

I'm sorry that I can't help more.

araujoarthur0 commented 1 year ago

@soulflyman no worries, thanks for the input!