Password reset email wrong language – Newspaper V 10.3.6

Posted in: Newspaper
Post count: 4

Hi!

We have recently updated to Newspaper V 10.3.6 and are quite happy with it.

There is a problem however;
The password reset emails generated from ajax requests (the login screen or the mobile menu) are in English, but our WordPress site language is Dutch. The emails from the wp-login.php screen are in Dutch, thus correct.

We are using PHP 7.0.33 (update is pending) on WordPress 5.5.2.

Is this a known bug?

Post count: 18283

Hello !

Please make sure that your wordpress language is in dutch. This seems to be a misconfiguration from wordpress. Newspaper theme only renders what wordpress exports: https://www.screencast.com/t/SMQyIyRS16

Let us know the result !

Thank you !

Post count: 4

Hi Vlad,

Thank you for your time.

Our WordPress language is definitely Dutch.
Screenshot

The e-mails sent from the /wp-login.php screen are therefore Dutch, and the wp-admin panel is also Dutch, as expected. Only the emails from the newspaper login screen are English.

Post count: 18283

Hello !

This is a wordpress function which you will need a plugin for. Take a look here maybe this will help you: https://wpml.org/forums/topic/cant-translate-reset-password-email/

Let us know the result !

Thank you !

Post count: 18283

Hello !

This is a wordpress function which you will need a plugin for. Take a look here maybe this will help you: https://wpml.org/forums/topic/cant-translate-reset-password-email/

Let us know the result !

Thank you !

Post count: 4

Hi!

I ended up creating my own email using the retrieve_password_message hook. It works fine but it’s to bad this is necessary after a newspaper update. It sounds like a bug to me.

Thanks.

Post count: 18283

Hello !

We are sorry for the misunderstanding !

I have passed this to our developers in order to take a look.

Thank you !

Post count: 4

Hi Vlad,

Thanks! To make this more clear for your developers; I think I’ve found the bug. In the old version the text generation looks like this (td_login.php)


$message = __('Someone has requested a password reset for the following account:') . "\r\n\r\n";
$message .= network_home_url( '/' ) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n";
$message .= __('To reset your password, visit the following address:') . "\r\n\r\n";
$message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";

And in the new version like this


$message = 'Someone has requested a password reset for the following account:' . "\r\n\r\n";
$message .= network_home_url( '/' ) . "\r\n\r\n";
$message .= sprintf('Username: %s', $user_login) . "\r\n\r\n";
$message .= 'If this was a mistake, just ignore this email and nothing will happen.' . "\r\n\r\n";
$message .= 'To reset your password, visit the following address:' . "\r\n\r\n";
$message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";

The translation function __() seems to be simply forgotten during the migration to the td_composer plugin. Furthermore you are not passing the user data to the ‘retrieve_password_message’ hook, so it’s mostly useless. It’s implemented like this (td_login.php);
$message = apply_filters('retrieve_password_message', $message, $key);
But it should be (and it’s an easy fix) to do it like this:

$message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );

so you can actually generate a working link in a user function. You need the $user_login for this.

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.