Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#11832 closed defect (bug) (fixed)

merge_with() inconsistency in load_textdomain()

Reported by: SergeyBiryukov Owned by: westi
Milestone: 3.0 Priority: normal
Severity: major Version: 2.9
Component: I18N Keywords:
Focuses: Cc:


This code is used in wp-includes/pomo/translations.php:

function merge_with(&$other) {
	$this->entries = array_merge($this->entries, $other->entries);

It creates problems with numeric keys. For example, _e('2') outputs 4 on a localized version, regardless of the value in a .mo file.
Perhaps something like this should be used:

function merge_with(&$other) {
	foreach ( $other->entries as $key => $value )
		$this->entries[$key] = $value;

Change History (6)

#1 @nbachiyski
11 years ago

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

#2 @SergeyBiryukov
11 years ago

The current WordPress 3.0-alpha revision still uses array_merge(). Will it be synchronized with GlotPress?

#3 @nbachiyski
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#4 @nbachiyski
11 years ago

  • Owner changed from nbachiyski to westi
  • Severity changed from normal to major
  • Status changed from reopened to assigned

westi, can you sync WordPress pomo with GlotPress?

#5 @nbachiyski
11 years ago

  • Milestone changed from Unassigned to 3.0

#6 @automattor
11 years ago

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

(In [13228]) Sync pomo. Props nbachiyski. fixes #11832

Note: See TracTickets for help on using tickets.