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

WordPress Trac noreply at wordpress.org
Mon Sep 5 11:23:09 UTC 2016


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

Comment (by tfrommen):

 Replying to [comment:37 swissspidy]:
 > Agree, we can get rid of that extra check, although I usually like more
 strict comparisons.

 In case I'm checking for '''presence''', I'm all strict, too. In this
 case, however, we check for '''absence''', and furthermore can spare an
 unnecessary check. That's why I suggested to combine the two checks -
 which you already implemented. :)

 > Regarding `$previous_locale`, this won't work because that would make
 `$previous_locale` equal to `$locale`. I'm writing a test right now to
 demonstrate that `$previous_locale` is really the previous locale.

 Well, forget my comment on this. It doesn't make any sense. I got
 distracted while reading your patch and then again while writing the
 comment here. :) I thought I saw some initialization where it wasn't (yet)
 needed, but obviously this was not the correct place.

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


More information about the wp-trac mailing list