[wp-trac] [WordPress Trac] #26511: Introduce a locale-switching function

WordPress Trac noreply at wordpress.org
Tue Sep 6 22:47:12 UTC 2016


#26511: Introduce a locale-switching function
--------------------------------------+------------------------
 Reporter:  johnbillion               |       Owner:
     Type:  feature request           |      Status:  reviewing
 Priority:  normal                    |   Milestone:  4.7
Component:  I18N                      |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:41 ocean90]:
 > The function/method name `restore_locale()` is ambiguous. Which locale
 is restored? For multisite we have `restore_current_blog()`. The DocBlock
 for `restore_locale()` mentions "previous locale". Maybe name it
 `restore_previous_locale()`?

 If the functions are modeled after
 `switch_to_blog()/restore_current_blog()`, shouldn't it be called
 `restore_current_locale()` to avoid confusion?

 The discrepancy could throw someone off. ''(Is it
 `restore_previous_locale()` or `restore_current_locale()`?
 `restore_current_blog()` or `restore_previous_blog()`?)''

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


More information about the wp-trac mailing list