Translating WordFence
/* Translate Wordfence plugin */
// Added by Horacio Figarella
add_action( 'init', 'Translate_Wordfence' );
function Translate_Wordfence() {
$browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); // Get the browser language
switch ($browser_lang){ // Set language independently of the country version
case "es": $locale = 'es_ES'; break; case "fr": $locale = 'fr_FR'; break; case "it": $locale = 'it_IT'; break; case "pt": $locale = 'pt_BR'; break; case "co": $locale = 'co'; break; default: $locale = 'en_US';
} // and set it to one of these 6 languages of this site
$domain = 'wordfence'; // Domain 1
$mofile = $domain . '-' . $locale . '.mo'; // Contains all translation for all 3 domains
unload_textdomain( $domain );
load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile );
$domain = 'wordfence-2fa'; // Domain 2
//$mofile = $domain . '-' . $locale . '.mo'; // Not needed
unload_textdomain( $domain );
load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile );
$domain = 'wordfence-ls'; // Domain 3
//$mofile = $domain . '-' . $locale . '.mo'; // Not needed
unload_textdomain( $domain );
load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile );
}
from https://wordpress.org/support/topic/old-but-still-neccessary-translation-option-for-wordfence/