#26066 closed defect (bug) (fixed)
Invalid i18n in Site Content dashboard widget
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.8 | Priority: | high |
Severity: | normal | Version: | 3.8 |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
'%s Posts', '%s Pages' is not localizable, as noted previously in ticket:17609:3 and #19099.
Unfortunately, that's exactly what the new Site Content dashboard widget does (see #25824).
Are we going to allow custom post types in the widget in 3.8? If yes, we need to figure out a way to make it localizable, probably with a new set of post type labels.
I'd suggest sticking with posts and pages for now, and continue to avoid post type and taxonomy names in generic strings until we have a way to do the i18n properly.
Attachments (3)
Change History (14)
#2
@
10 years ago
Are we going to allow custom post types in the widget in 3.8? If yes, we need to figure out a way to make it localizable, probably with a new set of post type labels.
One potential option would be to allow translators to change the word order and add colons (like in ticket:25459:25459.2.diff for #25459), so the strings would become: 'Posts: %s', 'Pages: %s', 'Books: %s', etc.
#4
@
10 years ago
There are Posts and Pages (with capitalized letters) x comments and in moderation (with small letters)?
#5
@
10 years ago
26066.diff adds a new num_items
label to register_post_type
. To make use of the new label, a custom post type would use something like:
register_post_type( 'test', array( 'public' => true, ... 'labels' => array( ... 'num_items' => _n_noop( '%s item', '%s items' ) ), ) );
Unfortunately for all existing post types that don't define the num_items
label, the Site Content widget will show "x posts" or "x pages". I also believe this is not the only good use case for the new label.
#6
@
9 years ago
26066.2.patch is a first try at fixing thing mentioned in 25824#comment:14
#7
@
9 years ago
- Keywords commit added
Decision time. Let's reduce this to whatever it was in 3.7. That means posts and pages only (no custom post types). Sounds like 26066.patch?
#8
@
9 years ago
- Keywords commit removed
- Priority changed from normal to high
Okay, so there are other issues, which attempt to be covered by 26066.2.patch.
#9
@
9 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In 26704:
26066.patch also fixes an incorrect argument passed to
_n()
for the 'in moderation' text (a copy/paste error in [26144]).