WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#37055 closed defect (bug) (wontfix)

Translations for plugin in plugin

Reported by: sebastian.pisula Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords: close
Focuses: Cc:

Description

why translations for plugins in plugin (load_plugin_textdomain) must have domain before locale ?

$mofile = $domain . '-' . $locale . '.mo';

I have plugin with domain "my-plugin" and dir languages so WP search languages/my-plugin-pl_PL.mo

In plugin lang dir should looking for languages/pl_PL.mo

Change History (2)

#1 @swissspidy
5 years ago

  • Component changed from General to I18N
  • Keywords close added

That's mostly for historical reasons I think and not something that you should worry about because

a) inside wp-content/languages domain-locale.mo totally makes sense.
b) every plugin on dotorg should use language packs
c) load_plugin_textdomain() is therefore needed anymore with 4.6+
d) changing this for no reason would negatively impact performance because of additional file existence checks.

#2 @dd32
5 years ago

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

I agree that this isn't something we should change, although for plugins which bundle their own translations it means that they've got longer filenames, it doesn't cause any issue and supporting locale-only.mo would require extra filesystem checks for no tangible benefit.

Note: See TracTickets for help on using tickets.