WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 5 months ago

#45161 closed defect (bug) (fixed)

Set translations for Gutenberg scripts.

Reported by: herregroen Owned by: herregroen
Milestone: 5.0 Priority: normal
Severity: normal Version: 5.0
Component: I18N Keywords: has-patch commit fixed-5.0
Focuses: javascript Cc:

Description

Once #45103 has been merged translations should be set for all relevant Gutenberg scripts using wp_set_script_translations.

This will mean that once #meta3876 and #meta3748 are resolved translation files will be downloaded and updated per the usual process and loaded into wp.i18n.

Attachments (2)

45161.diff (1.3 KB) - added by herregroen 7 months ago.
45161.2.diff (7.2 KB) - added by herregroen 7 months ago.

Download all attachments as: .zip

Change History (11)

#1 @SergeyBiryukov
7 months ago

  • Component changed from General to I18N
  • Milestone changed from Awaiting Review to 5.0

@herregroen
7 months ago

#2 @omarreiss
7 months ago

Patch looks good to me. @herregroen please feel free to commit

#3 @pento
7 months ago

I'd like to see it properly working before we commit it, but otherwise it looks good. 🙂

This ticket was mentioned in Slack in #core-js by omarreiss. View the logs.


7 months ago

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


7 months ago

#6 @ocean90
7 months ago

  • Keywords has-patch commit added

45161.diff is working for me with the current available language packs for 5.0-beta3. Make sure to deactivate the Gutenberg plugin.

I'd only replace array_key_exists() with isset() which should be good enough here.

@herregroen
7 months ago

#7 @herregroen
7 months ago

  • Owner set to herregroen
  • Resolution set to fixed
  • Status changed from new to closed

In 43878:

I18N: Set translations for all WordPress packages scripts.

Calls wp_set_script_translations for all packages scripts that have translations. Also correctly sets the domain on the translations.

Props omarreiss, pento, ocean90.
Fixes #45161.

#8 @herregroen
7 months ago

  • Keywords fixed-5.0 added
  • Resolution fixed deleted
  • Status changed from closed to reopened

#9 @SergeyBiryukov
5 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 44239:

I18N: Set translations for all WordPress packages scripts.

Calls wp_set_script_translations for all packages scripts that have translations. Also correctly sets the domain on the translations.

Props omarreiss, pento, ocean90.
Merges [43878] to trunk.
Fixes #45161.

Note: See TracTickets for help on using tickets.