WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 2 years ago

#10382 closed defect (bug) (fixed)

plugins descriptions aren't localized

Reported by: Denis-de-Bernardy Owned by: nbachiyski
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.8
Component: I18N Keywords: has-patch tested
Focuses: Cc:

Description

WP uses the wrong argument for load_plugin_textdomain().

Attachments (1)

plugin-localization.diff (938 bytes) - added by Denis-de-Bernardy 5 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Denis-de-Bernardy5 years ago

  • Keywords dev-feedback added

while we're on the topic, is there any reason for which theme descriptions aren't localizable?

comment:3 follow-up: Denis-de-Bernardy5 years ago

no?

comment:4 Denis-de-Bernardy5 years ago

try this: in load_plugin_textdomain(), add a var_dump($path). See it return a completely erroneous value. With or without a "Domain Path: /lang" header in the plugin.

comment:5 Denis-de-Bernardy5 years ago

that would be upon visiting the plugins page, of course.

comment:6 Denis-de-Bernardy5 years ago

oh, lol, I'm not making sense of the no. opened #10383 for translating theme descriptions then. :D

comment:7 pavelevap5 years ago

  • Cc pavelevap@… added

For me also translation does not work. You can test plugin Custom Field Images (version 2.0). It contains Czech translation file and also uses translated plugin description, but these are always displayed in original english...

comment:8 in reply to: ↑ 3 nbachiyski5 years ago

Replying to Denis-de-Bernardy:

no?

Sorry about my words frugality. As you correctly realized after that, my No meant there was no reason.

comment:9 Denis-de-Bernardy5 years ago

  • Keywords tested added; dev-feedback removed

Yeah. It initially sounded very scary. :-D

comment:10 pavelevap5 years ago

I tried attached patch, but it does not help to resolve my problem (description is not translated)....

comment:11 Denis-de-Bernardy5 years ago

Odd... It worked fine with my own tests... Try adding two lines at the beginning of the plugin file:

http://plugins.trac.wordpress.org/browser/custom-field-images/trunk/custom-field-images.php

Author: scribu
Author URI: http://scribu.net/
Plugin URI: http://scribu.net/wordpress/custom-field-images

Change that to:

Author: scribu
Author URI: http://scribu.net/
Plugin URI: http://scribu.net/wordpress/custom-field-images
Text Domain: custom-field-images
Domain Path: /lang

comment:12 pavelevap5 years ago

Yes, these two lines helped and it works now...

There are also other problems:

1) On plugins page - plugins are listed alphabetically - but when plugin name is translated, then plugins are listed alphabetically by original (and not translated) name.

2) I tried it also with 2.9-rare and there are some problems adding these two lines (there is NULL at the top of page) and activating plugin...

comment:13 azaozz5 years ago

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

(In [11716]) Fix plugins descriptions localization, props Denis-de-Bernardy, fixes #10382

comment:14 azaozz5 years ago

  • Milestone changed from 2.8.2 to 2.9

comment:15 pavelevap5 years ago

Does not work for me without adding these lines to plugin:

Text Domain: custom-field-images
Domain Path: /lang

So, it is problem of this plugin and author should add these lines or it problem of Wordpress?

comment:16 dd325 years ago

So, it is problem of this plugin and author should add these lines or it problem of Wordpress?

If the plugin does not specify its Text Domain, and the path to the language files, theres nothing WordPress can do, it cant guess it very well.

comment:17 follow-up: pavelevap5 years ago

OK, but translated plugin description is displayed only when plugin was sometimes activated. When I download fresh plugin and do not activate it, then description is not translated...

comment:18 in reply to: ↑ 17 johnbillion2 years ago

Replying to pavelevap:

OK, but translated plugin description is displayed only when plugin was sometimes activated. When I download fresh plugin and do not activate it, then description is not translated...

See #20320.

Note: See TracTickets for help on using tickets.