I'd like to change some translatable text of a plugin I'm using, Buddypress Group Email Subscription. The text is: No Email (users will read this group on the web - good for any group - the default)
, and I want to change it to No Email (users will read this group on the web - good for any group)
, since it's not really default. Here's what I've done so far:
.pot
file to bp-ass-en_US.po (since all the other translations files for the plugin are in the form bp-ass-xx_XX.po
). edited the appropriate lines to read:
#: bp-activity-subscription-functions.php:1087
msgid ""
"No Email (users will read this group on the web - good for any group - the "
"default)"
msgstr ""
"No Email (users will read this group on the web - good for any group)"
compiled the .po file into a .mo file (msgfmt -o bp-ass-en_US.mo bp-ass-en_US.po
), and put them both, bp-ass-en_US.mo and bp-ass-en_US.po in /wp-content/languages.
/wp-content/languages/buddypress-group-email-subscription
, and /wp-content/languages/bp-ass
. But the translation isn't taking. I still see the old text. I can't figure out what I'm doing wrong. I checked the .po file to make sure there wasn't a similar string elsewhere that I should be editing instead, but it's just that one.
For reference, here's the offending line in the plugin's code:
<?php _e( 'No Email (users will read this group on the web - good for any group - the default)', 'bp-ass' ) ?></label>
I'd like to change some translatable text of a plugin I'm using, Buddypress Group Email Subscription. The text is: No Email (users will read this group on the web - good for any group - the default)
, and I want to change it to No Email (users will read this group on the web - good for any group)
, since it's not really default. Here's what I've done so far:
.pot
file to bp-ass-en_US.po (since all the other translations files for the plugin are in the form bp-ass-xx_XX.po
). edited the appropriate lines to read:
#: bp-activity-subscription-functions.php:1087
msgid ""
"No Email (users will read this group on the web - good for any group - the "
"default)"
msgstr ""
"No Email (users will read this group on the web - good for any group)"
compiled the .po file into a .mo file (msgfmt -o bp-ass-en_US.mo bp-ass-en_US.po
), and put them both, bp-ass-en_US.mo and bp-ass-en_US.po in /wp-content/languages.
/wp-content/languages/buddypress-group-email-subscription
, and /wp-content/languages/bp-ass
. But the translation isn't taking. I still see the old text. I can't figure out what I'm doing wrong. I checked the .po file to make sure there wasn't a similar string elsewhere that I should be editing instead, but it's just that one.
For reference, here's the offending line in the plugin's code:
<?php _e( 'No Email (users will read this group on the web - good for any group - the default)', 'bp-ass' ) ?></label>
You are doing things correctly. Either the plugin is including its languages folder and text domain in a wrong way, or your locale is wrong.
Note: the following paragraph is outdated (written 4-5 years ago), so consider using Loco Translate instead of Codestyling Localization which was recommended before, as it is no longer maintained and might be a security threat to your site!
You can install Codestyling Localization plugin in order to check if the plugin is being localized as it should be, and if it doesn't give any warnings, then try forcing the locale of the site from Settings -> Language dropdown menu.
Update: Without plugins you can add the file in plugindir/languages/ as textdomain-xx_XX.mo and if you want it to remain translated after plugin update, add it in wp-content/languages/plugins/ with the same name of the file(s). wp-content/languages/themes/ is the directory for theme po & mo files.
Plugin and theme translations won't be loaded, if in wp-content/languages/!