I have two languages on my website. German and English.
Everything is already translated. The links on the login form are also redirecting to the right language.
My only problem: if something went wrong in the registration-process and an error occurs, the user will be redirected to main language. Is there any hook, I can redirect to the current language and show the errors in the correct language?
For the Registration URL (on the login page) I used the following function:
// Change wp registration url
function wp_change_register_url($link){
return str_replace(site_url('wp-login.php?action=register', 'login'),site_url('wp-login.php?action=register&lang=' . ICL_LANGUAGE_CODE, 'login'),$link);
}
add_filter('register','wp_change_register_url');
Thank you!