Skip to:

Opened 11 years ago

Closed 10 years ago

#5030 closed enhancement (fixed)

Use load_plugin_textdomain() for loading language files

Reported by: boonebgorges's profile boonebgorges Owned by: boonebgorges's profile boonebgorges
Milestone: 1.8 Priority: high
Severity: major Version:
Component: Core Keywords: has-patch
Cc: johnjamesjacoby, nacin


Continuation of conversation begun at


  • BP currently uses load_textdomain() to load language files. Historically, we've done this because we encourage language pack users to download .mos separately and store them in wp-content/languages, and load_plugin_textdomain() does not support this location in an obvious way.
  • However, upcoming changes to the way that language packs are distributed from will require that BP use load_plugin_textdomain() is a working but clunky patch for accomplishing what needs to be done. nacin has suggested that he has another approach; this might involve changes to load_plugin_textdomain() (such as un-deprecating the absolute path parameter).

Attachments (1)

5030.patch (1.3 KB) - added by boonebgorges 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 @boonebgorges
11 years ago

  • Cc johnjamesjacoby nacin added

#2 @nacin
10 years ago

4857.05.patch won't work for a custom language or plugin directories.

What I was thinking is call load_plugin_textdomain() for the relative 'bp-languages' path - and if it returns false (and it always will by default), go ahead and do what you do currently. But this will mean that when load_plugin_textdomain() changes, you'll automatically get those goodies.

#3 @boonebgorges
10 years ago

Cool, thanks for the clarification. See 5030.patch.

10 years ago

#4 @boonebgorges
10 years ago

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

In 7204:

Attempt to use load_plugin_textdomain() before loading translations from WP_LANG_DIR

This will ensure compatibility with future support for automatic translation
downloads on, while continuing to allow translations to be
stored in wp-content/languages/.

Fixes #5030

Note: See TracTickets for help on using tickets.