WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#53589 new defect (bug)

Twenty Twenty One: Translation file loaded twice

Reported by: Chouby Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.6
Component: Bundled Theme Keywords: needs-testing
Focuses: performance Cc:

Description

Steps to reproduce:

  1. Setup a WordPress install with only Twenty Twenty One.
  2. Add the plugin Query Monitor
  3. Visit the front page and click on the Languages item of the Query Monitor admin bar menu.
  4. Check that the Twenty Twenty One translation file is loaded twice.

Analysis:
The first time, the translation file is loaded by _load_textdomain_just_in_time() due to a call to __() in https://github.com/WordPress/wordpress-develop/blob/5.7.2/src/wp-content/themes/twentytwentyone/inc/block-patterns.php#L20

The second time, the translation file is loaded by a direct call to load_theme_textdomain() in https://github.com/WordPress/wordpress-develop/blob/5.7.2/src/wp-content/themes/twentytwentyone/functions.php#L36

Change History (1)

#1 @desrosj
5 months ago

  • Keywords needs-testing added
  • Summary changed from Twenty Twenty One translation file loaded twice to Twenty Twenty One: Translation file loaded twice
Note: See TracTickets for help on using tickets.