[wp-trac] [WordPress Trac] #26511: Separate locale for the admin toolbar
WordPress Trac
noreply at wordpress.org
Tue Apr 28 06:33:33 UTC 2015
#26511: Separate locale for the admin toolbar
-----------------------------+------------------------------
Reporter: johnbillion | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: I18N | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by rmccue):
Related: if you have a multilingual network (i.e. sites have different
locales), then things that loop over the sites can break.
{{{
<?php
get_blog_option( 1, 'WPLANG' ) == '';
get_blog_option( 2, 'WPLANG' ) == 'de_DE';
// The site you start on will have the correct translations
get_current_blog_id() == 1;
get_locale() == 'en_US';
__( 'Hello' ) == 'Hello';
// Switch to a different site, and things start not making sense
switch_to_blog( 2 );
get_locale() == 'de_DE';
__( 'Hello' ) == 'Hello'; // Should be translated "Hallo"
}}}
This is causing a bug for us, as we loop over all sites to send a
newsletter on each site. When we switch to the site, we generate an email
for the site then send it. Turns out we're actually sending out a bunch of
emails in the wrong language right now. :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26511#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list