Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#18783 closed defect (bug) (fixed)

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

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


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 10 years ago.

Download all attachments as: .zip

Change History (7)

10 years ago

#1 @nacin
10 years ago

  • Keywords has-patch added

#3 @nacin
10 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
9 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
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Simple filter to force the locale:

function modify_locale(){
    return 'de_DE';

#6 in reply to: ↑ 5 @SergeyBiryukov
9 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.