time-to-leave icon indicating copy to clipboard operation
time-to-leave copied to clipboard

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

Open timagixe opened this issue 2 years ago • 13 comments

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

  • Node/npm version: Node 16
  • OS: MacOS latest
  • TTL version: latest

Screenshots Screen Shot 2023-02-19 at 11 29 30 AM

timagixe avatar Feb 19 '23 09:02 timagixe

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

tupaschoal avatar Feb 25 '23 10:02 tupaschoal

Can you assign this is to me

BikcromBiswas avatar Apr 09 '23 01:04 BikcromBiswas

Sure

tupaschoal avatar Apr 10 '23 10:04 tupaschoal

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 👍

RahulKannan12 avatar Apr 18 '23 15:04 RahulKannan12

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

araujoarthur0 avatar May 05 '23 14:05 araujoarthur0

@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 ?

RahulKannan12 avatar May 07 '23 04:05 RahulKannan12

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

araujoarthur0 avatar May 07 '23 12:05 araujoarthur0

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

BikcromBiswas avatar May 07 '23 12:05 BikcromBiswas

@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.

RahulKannan12 avatar Jun 03 '23 11:06 RahulKannan12

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.

soulflyman avatar Aug 23 '23 15:08 soulflyman

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.

araujoarthur0 avatar Sep 05 '23 17:09 araujoarthur0

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.

soulflyman avatar Sep 07 '23 15:09 soulflyman

@soulflyman no worries, thanks for the input!

araujoarthur0 avatar Sep 21 '23 00:09 araujoarthur0