[wp-trac] [WordPress Trac] #49263: Switching blog doesn't switch locale

WordPress Trac noreply at wordpress.org
Tue Jan 21 21:26:48 UTC 2020


#49263: Switching blog doesn't switch locale
-------------------------+------------------------------
 Reporter:  iandunn      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  I18N         |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |     Focuses:  multisite
-------------------------+------------------------------
Changes (by iandunn):

 * keywords:  2nd-opinion reporter-feedback => 2nd-opinion


Comment:

 🤔

 My first thought would be to cache expensive operations like those in a
 transient, but I'm guessing you're thinking of some other examples where
 that wouldn't work well? Or is that a concern even with the site names in
 the toolbar?

 Another idea would be to add a new parameter to `switch_to_blog()` which
 would let the caller explicitly define what should be switched. e.g.,

 {{{
 switch_to_blog( 4, null, array(
     'blog_id' => true,
     'table_prefix' => true,
     'object_cache' => true,
     'locale' => true,
 ) );
 }}}

 The default args could be set to the current behavior, so `locale` would
 be `false`.

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


More information about the wp-trac mailing list