Make WordPress Core

Opened 4 years ago

Last modified 4 months ago

#47373 reviewing enhancement

Extend Moment.js localization

Reported by: swissspidy's profile swissspidy Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: I18N Keywords: good-first-bug has-patch dev-feedback
Focuses: Cc:

Description

With the Gutenberg integration we also got Moment.js in core with some localization support.

However, only a few of the fields that Moment.js supports are localized in WordPress. If a plugin wants to use some features like relative time (e.g. "%s hours ago"), these bits won't be translated.

I suggest also localizing thinks like relativeTime and potentially others.

See https://momentjs.com/docs/#/i18n/ for a full list of things that could be localized in core.

Similar enhancement in the past for jQuery UI datepicker: #29420

Attachments (1)

47373.diff (1.1 KB) - added by manzoorwani.jk 4 years ago.

Download all attachments as: .zip

Change History (21)

@manzoorwani.jk
4 years ago

#1 @manzoorwani.jk
4 years ago

  • Keywords has-patch added; needs-patch removed

It will need the changes in this file. I am on it as well.

#2 @manzoorwani.jk
4 years ago

Here is the corresponding PR to Gutenberg Repo. #16728

#3 @manzoorwani.jk
4 years ago

With the PR being merged, I guess this is now ready to go ahead.

This ticket was mentioned in Slack in #core-editor by talldanwp. View the logs.


4 years ago

This ticket was mentioned in Slack in #core by sergey. View the logs.


4 years ago

#6 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.4
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


3 years ago

#8 @davidbaumwald
3 years ago

  • Milestone changed from 5.4 to Future Release

This ticket still needs a review, and with 5.4 Beta 1 landing tomorrow, this is being moved to Future Release. If any maintainer or committer feels this can be included in 5.4 or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

#9 @adrianduffell
2 years ago

If a plugin wants to use some features like relative time (e.g. "%s hours ago"), these bits won't be translated.

This behavior occurs in WooCommerce where relative times are not translated.

Could the patch please be reviewed? Thank you.

This ticket was mentioned in Slack in #core by chihsuan. View the logs.


11 months ago

This ticket was mentioned in Slack in #core by chihsuan. View the logs.


11 months ago

#12 @costdev
11 months ago

  • Keywords dev-feedback added
  • Milestone changed from Future Release to 6.1

With this being raised in Slack recently, this issue is still relevant. The patch looks straightforward and I think we can land it in 6.1.

It would be good to get feedback from someone with more i18n experience than myself.

@swissspidy @SergeyBiryukov what else might this need to move forward?

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


9 months ago

#14 @JeffPaul
9 months ago

  • Milestone changed from 6.1 to 6.2

As discussed ahead of today's scheduled 6.1 Beta 1 release party (see the Slack link above), it was deemed that this ticket was not ready and should be punted to the 6.2 milestone to be reviewed and addressed then.

This ticket was mentioned in Slack in #core by costdev. View the logs.


5 months ago

#16 @hellofromTonya
5 months ago

Hello all,

I see that Gutenberg's instance got an update. I'm curious:

Does it meet the needs of the enhancement request in this ticket?

If yes, then it might worth someone comparing the latest code https://github.com/WordPress/gutenberg/blob/trunk/packages/date/src/index.js#L70 to determine if the patch in this ticket is up-to-date.

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


4 months ago

#18 @costdev
4 months ago

This ticket was discussed during the recent bug scrub.

@SergeyBiryukov As the patch may need to be revised, and we're approaching 6.2 Beta 1 on February 7th, is this ticket still on your radar for 6.2, or should it be moved to Future Release?

Additional props: @mukesh27

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


4 months ago

#20 @mukesh27
4 months ago

  • Milestone changed from 6.2 to Future Release

Thanks @swissspidy for the ticket.

This ticket was discussed during the bug scrub. As this ticket still needs discussion and 6.2 Beta 1 is being released today, I'll move this to Future Release.

Additional props: @costdev

Note: See TracTickets for help on using tickets.