Opened 3 years ago
Closed 3 years ago
#11832 closed defect (bug) (fixed)
merge_with() inconsistency in load_textdomain()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | I18N | Version: | 2.9 |
| Severity: | major | Keywords: | |
| Cc: | SergeyBiryukov |
Description
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)
comment:1
nbachiyski
— 3 years ago
- Resolution set to fixed
- Status changed from new to closed
comment:2
SergeyBiryukov
— 3 years ago
The current WordPress 3.0-alpha revision still uses array_merge(). Will it be synchronized with GlotPress?
comment:3
nbachiyski
— 3 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
comment:4
nbachiyski
— 3 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?
comment:5
nbachiyski
— 3 years ago
- Milestone changed from Unassigned to 3.0
comment:6
automattor
— 3 years ago
- Resolution set to fixed
- Status changed from assigned to closed
Note: See
TracTickets for help on using
tickets.
This was fixed in http://trac.glotpress.org/changeset/375