Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#56669 closed defect (bug) (invalid)

Translation for the block editor not loaded from the theme

Reported by: benoitchantre's profile benoitchantre Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:

Description

My theme has translations for the block editor and tries to load them with

wp_set_script_translations( 'my-editor-script', 'my-text-domain', get_stylesheet_directory() . '/languages' );

My MO files are named as {locale}.mo
My JSON files are generated using WP-CLI with wp i18n make-json languages --no-purge

I can see with Query Monitor that WordPress tries to load {text-domain}-{locale}-{hash}.json instead of {locale}-{hash}.json (without text-domain)

Change History (2)

#1 follow-up: @swissspidy
21 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

You need to rename your file.

File name generation in WP-CLI has only recently been fixed to include the domain.

#2 in reply to: ↑ 1 @benoitchantre
21 months ago

Replying to swissspidy:

You need to rename your file.

File name generation in WP-CLI has only recently been fixed to include the domain.

Thank you for the quick reply @swissspidy.

Note: See TracTickets for help on using tickets.