Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 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

Description

Continuation of conversation begun at https://buddypress.trac.wordpress.org/ticket/4857#comment:20

Summary:

  • 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 wordpress.org will require that BP use load_plugin_textdomain()

https://buddypress.trac.wordpress.org/attachment/ticket/4857/4857.05.patch 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 12 years ago.

Download all attachments as: .zip

Change History (5)

#1 @boonebgorges
12 years ago

  • Cc johnjamesjacoby nacin added

#2 @nacin
12 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
12 years ago

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

@boonebgorges
12 years ago

#4 @boonebgorges
12 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 wordpress.org/extend, while continuing to allow translations to be
stored in wp-content/languages/.

Fixes #5030

Note: See TracTickets for help on using tickets.