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

WordPress Trac noreply at wordpress.org
Mon Jan 30 17:30:57 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 johnjamesjacoby):

 This is excellent!

 I have a thought about the new method names (`get_current_locale`,
 `get_current_user_id`). Apologies for it being after-commit 😔 and for
 maybe digging up an old conversation…

 Does `_current_` convey “global state”, even when used within the confines
 of a class or Namespace?

 Seems like existing global functions that start with `get_current_` or
 `restore_current_` established a pattern that “current” could be either
 “switched” or “originating” depending on the caller.

 Is this, perhaps, a decent opportunity to establish a more
 intentional/explicit/strict naming pattern to differentiate things that
 are “currently switched” from “reset back to what we started with” ?

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


More information about the wp-trac mailing list