Skip to content

Instantly share code, notes, and snippets.

@runezero
Created May 25, 2022 14:00
Show Gist options
  • Select an option

  • Save runezero/fe63d1561879de1ecf3abf77df369d42 to your computer and use it in GitHub Desktop.

Select an option

Save runezero/fe63d1561879de1ecf3abf77df369d42 to your computer and use it in GitHub Desktop.
[Add custom translations] Add custom translations to domains or text #wordpress
add_filter('gettext', 'wpdev_change_text', 20, 3);
function wpdev_change_text( $translated_text, $untranslated_text, $domain ) {
if ($untranslated_text == 'Please enter your username or email address. You will receive a link to create a new password via email.'){
$translated_text = 'Vul onderstaand uw email in. U krijgt van ons een mail met een link om uw wachtwoord opnieuw in te stellen.';
}
if ($untranslated_text =='Check your email for the confirmation link.'){
$translated_text = 'Check uw email voor de bevestigingslink.';
}
if ($untranslated_text =='Enter your new password below.'){
$translated_text = 'Voer onderstaand uw nieuwe wachtwoord in.';
}
if ($untranslated_text =='Your password has been reset.'){
$translated_text = 'Uw wachtwoord is aangepast.';
}
if ($untranslated_text =='Your password reset link appears to be invalid. Please request a new link below.'){
$translated_text = 'De wachtwoord-reset-link lijkt ongeldig. Hieronder kunt u een nieuwe link aanvragen.';
}
if ($untranslated_text =='Your password reset link has expired. Please request a new link below.'){
$translated_text = 'De wachtwoord-reset-link is verlopen. Hieronder kunt u een nieuwe link aanvragen.';
}
return $translated_text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment