[wp-trac] [WordPress Trac] #62348: Textdomain loaded even though translations do not exist bc textdomain have identical start phrase

WordPress Trac noreply at wordpress.org
Fri Nov 8 12:36:48 UTC 2024


#62348: Textdomain loaded even though translations do not exist bc textdomain have
identical start phrase
--------------------------+-------------------------
 Reporter:  kkmuffme      |       Owner:  swissspidy
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  6.8
Component:  I18N          |     Version:  6.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-------------------------

Comment (by kkmuffme):

 I didn't have time to debug it in detail yet, I just saw lots of repeated
 calls for `$wp_textdomain_registry->get( 'do-something'` in a workflow
 where the locale was switched and textdomains unloaded (e.g. cron sending
 emails in 12 different languages)

 {{{#!php
 <?php
         if ( ! $wp_textdomain_registry->has( $domain ) ) { // this
 returned true for do-something
                 return false;
         }
 }}}

 I just took a look at it now quickly, and it seem, and it seems that it's
 not actually bc of https://github.com/WordPress/wordpress-
 develop/pull/7735/files#diff-
 00d2e07a27c8cddbc39e516791b3afbbc2b4517b3000b7ad167e45b91e8e81a3L124 but
 bc https://github.com/WordPress/wordpress-develop/pull/7735/files#diff-
 00d2e07a27c8cddbc39e516791b3afbbc2b4517b3000b7ad167e45b91e8e81a3R125 is
 set and therefore it returns true (`in_array( $domain,
 $this->domains_with_translations, true )` seems indeed to be dead code,
 but it would make it return true too incorrectly)

 I'm not really familiar with WP's i18n, but does it sound plausible to you
 that `isset( $this->current[ $domain ] ) ||` is still set after the
 language was switched? (or the textdomain unloaded manually)

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


More information about the wp-trac mailing list