Just ran into this with my one-country webshop and figured out a way to do it from a child theme, no need to edit a plugin’s files. =] Chances are pretty good people are using a child theme nowadays anyways, so:
1) Create a directory for storing the .po/.mo files inside your child theme. I picked wp-content/themes/mychild/l10n/wordfence
2) Create a .po file with contents like:
msgid "<strong>ERROR</strong>: The username or password you entered is incorrect. <a href=\"%2$s\" title=\"Password Lost and Found\">Lost your password</a>?"
msgstr "<strong>FOUT</strong>: De ingevulde gebruikersnaam of het wachtwoord is onjuist. <a href=\"%2$s\" title=\"Wachtwoord vergeten\">Wachtwoord vergeten</a>?"
3) Convert it to .mo. Without any plugins and on a *NIX system you can just do (make sure gettext
is installed first): msgfmt nl_NL.po -o nl_NL.mo
4) In your child theme’s functions.php, add this:
function my_wf_l10n() {
load_textdomain('default', get_stylesheet_directory() . '/l10n/wordfence/nl_NL.mo');
}
add_action('after_setup_theme', 'my_wf_l10n');
This will load the specified .mo file into the “default” text domain and voilá, translations now take effect. I’m pretty sure there are a ton of other strings you can translate this way as well, until WF finally decide to fix it themselves (if they ever do). Luckily the lockout page seems to be translatable using the good ol’ wp-content/languages/plugins/wordfence-nl_NL.mo
-
This reply was modified 5 years, 7 months ago by sahbi.
-
This reply was modified 5 years, 7 months ago by sahbi.