Ticket #19597 (closed task (blessed): fixed)

Opened 5 months ago

Last modified 3 months ago

Bundled plugins need a Text Domain header

Reported by: nacin Owned by:
Priority: normal Milestone: 3.4
Component: I18N Version:
Severity: normal Keywords:
Cc: pavelevap@…

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

19597.diff Download (1.4 KB) - added by nacin 4 months ago.
19597.2.diff Download (1.5 KB) - added by nacin 4 months ago.

Change History

 Pancakes should be a core plugin!

  • 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).

comment:3 follow-up: ↓ 7   nacin4 months 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.

comment:4 follow-up: ↓ 5   nacin4 months 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.

comment:5 in reply to: ↑ 4   SergeyBiryukov4 months 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.

nacin4 months ago

19597.diff Download 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.

comment:7 in reply to: ↑ 3 ; follow-up: ↓ 8   SergeyBiryukov4 months 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?

comment:8 in reply to: ↑ 7   nacin4 months 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.

nacin4 months ago

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

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

In [19965]:

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

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

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.

Note: See TracTickets for help on using tickets.