[wp-trac] [WordPress Trac] #53589: Twenty Twenty One translation file loaded twice

WordPress Trac noreply at wordpress.org
Mon Jul 5 12:02:04 UTC 2021


#53589: Twenty Twenty One translation file loaded twice
---------------------------+-----------------------------
 Reporter:  Chouby         |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Bundled Theme  |    Version:  5.6
 Severity:  normal         |   Keywords:
  Focuses:  performance    |
---------------------------+-----------------------------
 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

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


More information about the wp-trac mailing list