WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#10738 closed defect (bug) (fixed)

Add New strings need a context, so that they can be different for each menu

Reported by: nbachiyski Owned by: nbachiyski
Milestone: 2.9 Priority: low
Severity: normal Version:
Component: I18N Keywords: has-patch
Focuses: Cc:

Description

Currently all Add New strings in the menus are the same string for translation. In many languages they should be translated differently.

The patch adds context to the gettext function calls and adds a new function esc_html_x(), which both supports context and escapes the content.

Attachments (2)

add-new-context.diff (6.3 KB) - added by nbachiyski 5 years ago.
10738_Add-New-Themes_regression.patch (724 bytes) - added by nacin 4 years ago.

Download all attachments as: .zip

Change History (12)

nbachiyski5 years ago

comment:1 sirzooro5 years ago

Have you tried the _e('text|description', 'domain') syntax (read more)? I think it will does the trick.

comment:2 scribu5 years ago

  • Keywords reporter-feedback added

comment:3 nbachiyski4 years ago

  • Keywords reporter-feedback removed

sirzooro, the gettext contexts are something simliar, btu they are native gettext functionality, not a hack like the pipe syntax.

comment:4 ryan4 years ago

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

(In [12231]) Add context to strings. Props nbachiyski. fixes #10738

comment:5 nacin4 years ago

I'm thinking we should restore "Add New Themes." This patch converted it to "Add New." It makes sense in all of the other contexts, as you would be adding new "Users" (the name of the menu). But in this case, you're adding new themes, while the menu is called "Appearance."

comment:6 nacin4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:7 ryan4 years ago

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

comment:8 follow-up: dremeda4 years ago

Well the main nav heading is "Appearance" but when you click it, it drops you to the "Manage Themes" page, which is the first link under the heading, consistent with Plugins & Users.

You're not just adding new themes in this area so I think Apearance is appropriate. You are editing widgets and theme files which are all part of the appearance.

With all that said, I think the one thing that's missing, is the ability to search for a new theme from the "Manage Themes" page. It would be nice to have a search for new theme on that page.

This is also relevant in the plugins area, you can search for existing plugins from the "Manage Plugins" page but you cannot do a quick search for "NEW" plugins.

comment:9 in reply to: ↑ 8 nacin4 years ago

Replying to dremeda:

You're not just adding new themes in this area so I think Apearance is appropriate. You are editing widgets and theme files which are all part of the appearance.

Yes, I agree "Appearance" is appropriate. The question was "Add New" versus "Add New Themes," particularly since there is also "Widgets" in that submenu, but the "Add New" here only applied to themes.

Replying to dremeda:

With all that said, I think the one thing that's missing, is the ability to search for a new theme from the "Manage Themes" page. It would be nice to have a search for new theme on that page.

This is also relevant in the plugins area, you can search for existing plugins from the "Manage Plugins" page but you cannot do a quick search for "NEW" plugins.

Sounds like something for which you should submit a UI ticket. Jane has a few related to the plugins page, from what I recall.

Note: See TracTickets for help on using tickets.