Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#34134 closed defect (bug) (invalid)

Do not import strings without domains if string exists in Core

Reported by: niallkennedy's profile niallkennedy Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: I18N Keywords:
Focuses: template Cc:


I include strings translated by Core in my plugin to match WordPress behavior. I expect WordPress to skip importing my domainless string if it matches a Core msgid.

I truncate text and include the domainless __( '…' ) in my PHP code.

The same domainless string exists in WordPress Core.

I expect the string will not be imported into and therefore scoped to my plugin.

Change History (2)

#1 @SergeyBiryukov
8 years ago

AFAIK, using strings without a text domain in plugins is not encouraged, they should still have the plugin domain even if core uses the same string.

It's up to translation editors to make sure the translations are consistent.

#2 @dd32
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Plugins really shouldn't use strings without a textdomain. If core changes the string, suddenly the plugins string is no longer translated - it's just not a good user experience. currently has Translation Matching enabled, if you use 'My String' in a plugin and it's already translated in another project, it'll get imported to your plugin too (so translate in one project, and it's available for all others). In the past I've used what you're proposing too, but thankfully with everything in the one GlotPress instance, it's no longer really needed.

Core Trac is for Core Development only, it's not a support location for either WordPress or tools, if you'd like to discuss anything further to the request, feel free to drop in the #meta-i18n channel in Slack or file a ticket on the Make Trac under the component.

Note: See TracTickets for help on using tickets.