[wp-trac] [WordPress Trac] #59219: Output of JS version of human_time_diff in the editor is not translated

WordPress Trac noreply at wordpress.org
Mon Aug 28 01:27:29 UTC 2023


#59219: Output of JS version of human_time_diff in the editor is not translated
-------------------------+-------------------------------------------------
 Reporter:  ramonopoly   |      Owner:  (none)
     Type:  defect       |     Status:  new
  (bug)                  |
 Priority:  normal       |  Milestone:  6.4
Component:  Editor       |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch gutenberg-merge i18n-
  Focuses:               |  change
-------------------------+-------------------------------------------------
 Currently the output of
 [https://github.com/WordPress/gutenberg/blob/eed863a1aacecf166b43eaa90077ccd0f287ad41/packages/date/src/index.js#L592C8-L592C44
 humanTimeDiff()] in the editor is not translatable as it expects
 translated strings to pass to moment.js.

 These strings must be passed in the `relative` object as per the
 [https://momentjscom.readthedocs.io/en/latest/moment/07-customization/07
 -relative-time/ moment.js locale settings model].

 We need to update `wp_default_packages_inline_scripts()` to add relative
 time strings to the wp-date inline script.

 Gutenberg PR: https://github.com/WordPress/gutenberg/pull/53931


 Props to @oandregal for the original report:
 https://github.com/WordPress/gutenberg/issues/53888

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59219>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list