[wp-trac] [WordPress Trac] #51678: [5.6 Beta] Performance regression with i10n changes when translations files are not present

WordPress Trac noreply at wordpress.org
Sat Oct 31 15:44:05 UTC 2020


#51678: [5.6 Beta] Performance regression with i10n changes when translations files
are not present
-------------------------------------------------+-------------------------
 Reporter:  vedjain                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  high                                 |   Milestone:  5.6
Component:  I18N                                 |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing has-patch has-unit-    |     Focuses:
  tests dev-feedback 2nd-opinion                 |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  needs-testing has-patch has-unit-tests => needs-testing has-
     patch has-unit-tests dev-feedback 2nd-opinion


Comment:

 The proposal is to add the `set()` in `load_textdomain()`, which is
 applied in [https://github.com/WordPress/wordpress-develop/pull/677 PR
 677]:

 {{{#!php
 <?php
         if ( ! is_readable( $mofile ) ) {
                 $wp_textdomain_registry->set( $domain, false );
                 return false;
         }
 }}}


 This change prevents ''switching the locale during the same request when''
 the initial locale does not have a `.mo` file. This can be seen in the
 failing
 `Tests_Locale_Switcher::test_switch_reloads_plugin_translations_outside_wp_lang_dir`
 test.

 @vedjain notes:
 >It's unlikely that the result of `is_readable( $mofile )` will ever
 change during the context of a request


 Marking for `2nd-opinion` from @dd32, @ocean90, @swissspidy What do you
 think about ''disabling the ability to switch locale'' in the same request
 when the initial locale does not have a `.mo` file?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51678#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list