Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#18783 closed defect (bug) (fixed)

get_locale() should check site option in multisite even when WP_INSTALLING

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.3 Priority: normal
Severity: normal Version:
Component: Multisite Keywords: has-patch
Focuses: Cc:

Description

In multisite, get_locale() will check get_option('WPLANG') and then get_site_option('WPLANG'). We skip both when WP_INSTALLING (i.e. blog activation), but we should only skip the blog option at that point.

Follow up to a comment of mine in #14553.

Attachments (1)

18783.diff (570 bytes) - added by nacin 14 years ago.

Download all attachments as: .zip

Change History (7)

@nacin
14 years ago

#1 @nacin
14 years ago

  • Keywords has-patch added

#3 @nacin
14 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [19059]:

Check get_site_option(WPLANG) when WP_INSTALLING in mulitiste, just not the blog's option. fixes #18783.

#4 @foxinni
13 years ago

I got a plugin running on a multisite and there is definitely something up with the translation.

I tracked the problem down to the WPLANG option in http://localhost/<subsite>/wp-admin/options.php just being empty. I tried to update it, but it keeps reverting to blank. So down the line the issue starts with get_locale() looking for the WPLANG value in the site_options and then defaulting back to en_US because it's not picking it up from the wp-config.php defined WPLANG.

I'm assuming that the defined WPLANG in the wp-config.php does not apply in multi site instances.

I'm gonna write a filter to fix this, as there is ample hooks for that.

#5 follow-up: @foxinni
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Simple filter to force the locale:

function modify_locale(){
    return 'de_DE';
}
add_filter('locale','modify_locale');

#6 in reply to: ↑ 5 @SergeyBiryukov
13 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Replying to foxinni:

This ticket was closed on a completed milestone. Please open a new one.

Note: See TracTickets for help on using tickets.