I need to add a language file to an existing plugin. Not for translation reasons, but because I'd like to change all occurrences of a certain word to something else. While I could just drop another .po/.mo file set into the plugin's languages directory, I don't want to lose the language file when the plugin is updated.
It appears if the plugin used load_textdomain
to pull files from the WP_LANG_DIR
in addition to load_plugin_textdomain
then I could just drop in some .po files into /wp-content/languages/
and it would work.
BuddyPress does it this way, and has instructions for doing the exact sort of thing I'm trying to do: http://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/. I've changed every reference to "Group" to "Community".
All I have to do is drop the correctly-named files into the /wp-content/languages/
directory and the files are loaded.
The plugin I'm trying to modify is: BuddyPress Group Email Subscription.
It loads the languages using this function:
function activitysub_textdomain() {
load_plugin_textdomain( 'bp-ass', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
add_action( 'init', 'activitysub_textdomain' );