-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Bump Primer to 0.52.2 version #17667
Conversation
caption: I18n.t("text_in_hours"), | ||
trailing_visual: { text: { text: I18n.t("text_hours") } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bsatarnejad! There is already a translation in core that we can use here, I think: datetime.units.hour
:
units:
hour:
one: "hour"
other: "hours"
So you should be able to call I18n.t("datetime.units.hour", count: 2)
or I18n.t("datetime.units.hour.other")
(I'm not sure which is the more correct use of the I18n API though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @myabc
Thanks for the hint 👍
We may use units more in the future, so it would be better to define them generally in one place, not for a specific case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax trailing_visual: { text: { text: ..
looks somehow weird, but since it is coming from Primer, we have to stick with that 🤷♀️
@@ -64,7 +64,7 @@ class Meeting::TimeGroup < ApplicationForm | |||
label: Meeting.human_attribute_name(:duration), | |||
visually_hide_label: false, | |||
required: true, | |||
caption: I18n.t("text_in_hours"), | |||
trailing_visual: { text: { text: I18n.t("datetime.units.hour.other") } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 for "h"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ticket
https://community.openproject.org/wp/59860
What are you trying to accomplish?
Bump Primer to 0.52.2 version
Use trailing units in WP create relation modal and meeting add and edit form.