WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#19597 closed task (blessed) (fixed)

Bundled plugins need a Text Domain header

Reported by: nacin Owned by:
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:
PR Number:

Description

Hello Dolly and Akismet both use the default text domain, but neither specify the appropriate header to allow the Description field to be translated.

The Japanese localization forcibly replaces the description fields of both plugins for the download zip. This is not ideal.

Hello Dolly can continue to use default, but to trigger it, it will need to specify Text Domain: default. load_plugin_textdomain() will end up getting unnecessarily called in _get_plugin_data_markup_translate() but that's not the issue; it will allow the translate() call to be fired.

Akismet should be shifted to its own Akismet header and textdomain.

Please no commentary on the virtues of Hello Dolly, Akismet, bundled plugins, core plugins.

Attachments (2)

19597.diff (1.4 KB) - added by nacin 8 years ago.
19597.2.diff (1.5 KB) - added by nacin 8 years ago.

Download all attachments as: .zip

Change History (15)

#1 @scribu
8 years ago

Pancakes should be a core plugin!

#2 @pavelevap
8 years ago

  • Cc pavelevap@… added

Also bundled themes need localization of header information, please see my old ticket: http://core.trac.wordpress.org/ticket/15858

There are long explaining sentences, but header information is not allowed to be translated even if these strings are in .pot files (and GlotPress).

#3 follow-up: @nacin
8 years ago

I am thinking that Text Domain: default should be implied. Then no Text Domain header will needed to be added to Hello Dolly. As long as the strings are in the po file, we'll end up with a translation.

My reasoning here is two-fold: One, it will set a bad example for other plugins. Two, there's the thought that for language packs, we can infer a Text Domain header based on the plugin slug.

#4 follow-up: @nacin
8 years ago

  • Keywords 2nd-opinion added

Secondary thought:

Very few locales (two, I think) have taken pains to translate Akismet and Hello Dolly manually (and an upgrade kills them). It does create a better new user experience when they head to the Plugins screen for the first time. That said, since Hello Dolly contains English lyrics by an American musician, and Akismet needs to move to its own text domain, I'm considering a wontfix of this ticket.

#5 in reply to: ↑ 4 @SergeyBiryukov
8 years ago

Replying to nacin:

That said, since Hello Dolly contains English lyrics by an American musician

It would still be good to be able to translate its description.

@nacin
8 years ago

#6 @nacin
8 years ago

19597.diff runs all headers through translate(), falling back to the 'default' text domain. Side effects should probably be minimal, and performance negligibly worse.

The only remaining step will be to ensure that Hello Dolly's Name and Description makes it into the pot file. This will require a modification to makepot.php.

#7 in reply to: ↑ 3 ; follow-up: @SergeyBiryukov
8 years ago

Replying to nacin:

My reasoning here is two-fold: One, it will set a bad example for other plugins.

Would it make sense to only imply Text Domain: default for Hello Dolly, but not for other plugins?

#8 in reply to: ↑ 7 @nacin
8 years ago

Replying to SergeyBiryukov:

Would it make sense to only imply Text Domain: default for Hello Dolly, but not for other plugins?

Yes, but I'm weary of putting in an exception for Hello Dolly somewhere in the code. It would eliminate side effects, though.

@nacin
8 years ago

#9 @nacin
8 years ago

19597.2.diff is an alternative that carves out an exception for Hello Dolly.

#10 @SergeyBiryukov
8 years ago

Another option would probably be to add Hello Dolly to GlotPress, like importers (related: #16012).

#11 @nacin
8 years ago

In [19965]:

Allow bundled plugin headers to be translated. see #19597.

#12 @nacin
8 years ago

  • Keywords 2nd-opinion removed
  • Resolution set to fixed
  • Status changed from new to closed

Akismet and Hello Dolly headers are now added to wordpress-admin.pot. (http://i18n.trac.wordpress.org/changeset/19320/)

Considering this fixed. In time, Akismet will end up in its own textdomain, though we'll probably continue to add its headers to the main POT file, to ensure completeness in the translation of the Plugins screen even before a language pack is separately downloaded.

#13 @pavelevap
8 years ago

I am not sure, if plugin name, author and his website should be translatable? There are several strings which are not needed, I guess (Akismet and Hello Dolly).

Note: See TracTickets for help on using tickets.