[wp-trac] [WordPress Trac] #57123: Make it easier to switch to a user's locale

WordPress Trac noreply at wordpress.org
Mon Jan 30 10:26:08 UTC 2023


#57123: Make it easier to switch to a user's locale
------------------------------+-------------------------
 Reporter:  swissspidy        |       Owner:  swissspidy
     Type:  enhancement       |      Status:  closed
 Priority:  normal            |   Milestone:  6.2
Component:  I18N              |     Version:  4.7
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
------------------------------+-------------------------
Changes (by swissspidy):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55161" 55161]:
 {{{
 #!CommitTicketReference repository="" revision="55161"
 I18N: Introduce `switch_to_user_locale()`.

 This new function makes it easier to switch to a specific user’s locale by
 reducing duplicate code and storing the user’s ID as additional context
 for plugins to consume. Existing usage of `switch_to_locale()` in core has
 been replaced with `switch_to_user_locale()` where appropriate.

 Also, this change ensures `WP_Locale_Switcher` properly filters
 `determine_locale` so that anyyone using the `determine_locale()` function
 will get the correct locale information when switching is in effect.

 Props costdev.
 Fixes #57123.
 See #26511.
 }}}

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


More information about the wp-trac mailing list