[wp-trac] [WordPress Trac] #26511: Introduce a locale-switching function
WordPress Trac
noreply at wordpress.org
Thu Sep 8 10:01:54 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 swissspidy):
[attachment:26511.4.diff] is a new patch without the caching (at least for
now) and a few new tests related to `_load_textdomain_just_in_time()`,
which helped fix some bugs. Also contains some docs improvements etc. For
the tests to work, one needs to add the files from [attachment:de_DE.zip]
to the `tests/phpunit/data/languages` directory.
@SergeyBiryukov: `restore_current_blog()` is confusing because it means
"go back to the blog I was on before". Or for locales, "switch to a
locale, and then go back".
@GaryJ Looking at #25293, an interface would make sense, even though it's
probably a bit too much for now for only like 2-3 public methods.
The patch & naming on #25293 is interesting by the way. Think
`WP_Locale_State`. Also, it has a `is_switched()` method, which maybe
could be helpful in our case as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26511#comment:52>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list