#13996 closed defect (bug) (fixed)
Dysfunctional i18n function
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | I18N | Version: | 3.0 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | momo360modena, sergeybiryukov.ru@… |
Description
With at least the fr_FR and ru_RU translation, the "All" link at the top of the /wp-admin/edit-comments.php page is still in English.
The code used in WP is:
'all' => _nx_noop('All', 'All', 'comments'), // singular not used
Could there be an issue with _nx_noop()?
Attachments (1)
Change History (13)
- Summary changed from Dysfunctiona i18n function to Dysfunctional i18n function
Is the string not showing up in the pot file? I imagine makepot.php might need updating...
#: wp-admin/edit-comments.php:215 msgctxt "comments" msgid "All" msgid_plural "All" msgstr[0] "" msgstr[1] ""
As Sergey noted on wp-polyglots, it is the only place where _nx_noop() is used.
- Status changed from new to assigned
In that case, nx() doesn't work right.
SergeyBiryukov — 3 years ago
comment:6
SergeyBiryukov — 3 years ago
- Cc sergeybiryukov.ru@… added
- Keywords has-patch added; needs-patch removed
_nx_noop() is fine; it just returns an array. I dug deeper and found the problem in edit-comments.php: this string requires translating with context using _nx(), however _n() is used, which doesn't support context.
comment:7
nbachiyski — 3 years ago
- Resolution set to fixed
- Status changed from assigned to closed
comment:8
nbachiyski — 3 years ago
- Keywords has-patch removed
- Milestone changed from 3.0.1 to 3.1
- Resolution fixed deleted
- Status changed from closed to reopened
Sergey is right and his patch is in for 3.0.1.
For 3.1, I would like to make the *_noop() functions return an associative array, because using these indices is totally incomprehensible.
Along that, we should introduce a translate_nooped_plural() function to:
- Hide the complexity of the conditional use of _n() or _nx(), depending on the presence of context.
- Make localization of the places, where we lazy-translating noop-ed strings.
comment:9
nbachiyski — 3 years ago
- Milestone changed from Awaiting Triage to 3.1
comment:10
jane — 3 years ago
- Keywords needs-patch added
@nbachiyski: Freeze for 3.1 is a few days away. Did you still want to put in an update in this release?
comment:11
nbachiyski — 3 years ago
- Resolution set to fixed
- Status changed from reopened to closed
(In [16073]) Introduce and use translate_nooped_plural(). Fixes #13996
- _n_noop() and _nx_noop() now return associative arrays for greater clarity
- translate_nooped_plural() takes one such associative array and translates it
- it works on both the result from _n_noop() and from _nx_noop()
- this breaks backwards compatibility, but I doubt any plugin uses it (I will do a global grep to confirm)
- translate_nooped_plural() is applied where applicable
comment:12
scribu — 15 months ago
Follow-up: #20188

I can confirm it, with German lanugage it's the same.