[wp-trac] [WordPress Trac] #62154: Latest beta Warnings Function load_plugin_textdomain was called incorrectly.

WordPress Trac noreply at wordpress.org
Fri Oct 4 15:09:47 UTC 2024


#62154: Latest beta Warnings Function load_plugin_textdomain was called
incorrectly.
--------------------------+------------------------
 Reporter:  neo2k23       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  I18N          |     Version:  trunk
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------

Comment (by room34):

 Here's another unexpected twist. I'm just trying to add translation
 support to another of my plugins. I use Poedit for this, as is
 [recommended in the
 documentation](https://developer.wordpress.org/plugins/internationalization/localization/#poedit).

 Poedit would not generate the `.pot` file, saying the plugin was not
 translation-ready. An error in the log file indicated that
 `load_plugin_textdomain()` was missing, among a couple of other things. I
 temporarily added the function call to the plugin, and Poedit was then
 able to create the file.

 I did confirm that Poedit seems to be able to work with the plugin fine
 after creating the `.pot` file; it just needs `load_plugin_textdomain()`
 to be in the plugin during the initial creation. Still, this is likely why
 a lot of plugins call that function even if they technically don't need
 to, and I'm sure many of plugin developers also use Poedit.

 From what I've seen here, this likely won't be an issue if plugins don't
 call the function too early, but it does complicate the suggestion that
 plugins don't need to call the function at all.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62154#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list