Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix date time picker translations on Order cycles screen #5995

Conversation

andresgutgon
Copy link
Contributor

What? Why?

We initialise jQuery plugin on app/assets/javascripts/admin/util.js.erb but then we override those defaults on app/assets/javascripts/admin/order_cycles/order_cycles.js.erb.coffee. Now both plugin initialisations use the same defaults.

Also added 3 missing translations for Done, Now and Time copies on that time picker popover.

Closes #1803

What should we test?

  1. Log in as enterprise user or super admin
  2. Change your language to other than english
  3. Go to the order cycles menu
  4. Create a new order cycle or edit a current one
  5. See the calendar dropdown
  6. This dropdown also appears in the "reports" menu

Release notes

Changelog Category: Fixed

So the thing is we initialize jQuery plugin on `admin/util.js.erb` but
then we override those defaults on order_cycles.js.erb.coffe. Now both
plugin initializations use the same defaults. Also added 3 missing
translations for `Done`, `Now` and `Time` copies on that timepicker popover
Copy link
Contributor

@sauloperez sauloperez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool @andresgutgon ! Thank you very much for this super useful contribution! 😍 A pleasure to see you here. You just improved the experience of lots of users ❤️

@filipefurtad0 filipefurtad0 self-assigned this Sep 16, 2020
@filipefurtad0 filipefurtad0 added the pr-staged-uk staging.openfoodnetwork.org.uk label Sep 16, 2020
@filipefurtad0
Copy link
Contributor

Hey @andresgutgon :-)

I've staged the PR and checked the pages you mention render correctly:

image

image

The added translation keys should work fine and make this translatable.

Nice to see you around!
Thanks for this, moving to Ready to Go.

@filipefurtad0 filipefurtad0 added prod-test and removed pr-staged-uk staging.openfoodnetwork.org.uk prod-test labels Sep 16, 2020
@luisramos0
Copy link
Contributor

ah, I didnt manage to fix this one. So easy! Just set the values straight in the datetimepicker!!! and dont override them :-)
I tested it now locally with Spanish, it works!
Ideally we would not be using global window constants but instead do this with angular components/controllers, something for next time 👍

Thanks a lot for your contribution @andresgutgon

@luisramos0 luisramos0 merged commit f061545 into openfoodfoundation:master Sep 17, 2020
@andresgutgon andresgutgon deleted the fix/datetime-picker-ui-pick-the-right-translations-on-order-cycles branch September 17, 2020 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing translations : calendar
5 participants