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

WordPress Trac noreply at wordpress.org
Tue Jan 31 13:21:27 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:
------------------------------+-------------------------

Comment (by swissspidy):

 Thanks for raising that. I see how it is confusing that e.g.
 `::restore_current_locale()` refers to the "original" locale and
 `::get_current_locale()` refers the the currently switched to locale.

 Suggestion:

 Rename `::get_current_locale()` to `::get_locale()` and
 `::get_current_user_id()` to `::get_user_id()`.

 This way, the existing pattern in core ("current" referring to
 "originating") is unchanged.

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


More information about the wp-trac mailing list