Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 9 replies, has 2 voices.

Last updated by Fabio Fava 3 months, 4 weeks ago.

Assigned support staff: Noman.

Author Posts
May 16, 2020 at 3:28 pm #6147467

Fabio Fava

I am trying to: translate the "Lost Password" string on my site's login page.

Link to a page where the issue can be seen: hidden link

I expected to see: "Lost Password" below "Remember Me"

Instead, I got: "Contraseña Perdida" (in Spanish, main site language) below "Remember Me"

I can't find where to translate this string, hope we can get this. Thanks! Cheers!

May 17, 2020 at 10:42 am #6150831

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. Looks like you are using ‘Theme My Login’ plugin for displaying login form on this hidden link page. Could you please follow the below steps and let me know how it goes?

1. Please scan Theme My Login plugin from WPML >> Theme and plugins localization page.

2. Generate .mo files from top of the WPML >> Theme and plugins localization page.

3. Then search your required string from WPML >> String Translation page.

4. Clear your site cache.

Here is step by step instructions to translate theme/plugin strings:
https://wpml.org/documentation/getting-started-guide/theme-localization/#scanning-the-theme-and-plugins

Please let me know if this resolves your issue or if you need further assistance with this issue.

Thank you

May 17, 2020 at 11:24 am #6151043

Fabio Fava

Hi Noman,

I've done all the steps proposed, but still can't find "Contraseña" anywhere. All strings there are in English, none in Spanish. Yet I sill see it in Spanish for all languages... Isn't that a WordPress String? No matter TML is managing login, it reads those strings from WordPress...

I've already tried on WordPress Strings, but couldn't find either. Can't find where it comes from.

May 17, 2020 at 12:08 pm #6151493

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for trying those steps, To take a closer look on this issue, please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and debug the issue.

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to deactivate and reactivate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

Thank you

May 19, 2020 at 12:08 pm #6167183

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Looks like you are using the older version (6.4.17) of Theme my login plugin and the latest version is 7.0.15. You can upgrade it to the latest version and see if this resolves your issue.

Fow now I have fixed this issue by following below steps:
1. Replaced below code:

echo '<li><a href="' . esc_url( $link['url'] ) . '" rel="nofollow">' . esc_html( $link['title'] ) . '</a></li>' . "\n";

With:

echo '<li><a href="' . esc_url( $link['url'] ) . '" rel="nofollow">' . esc_html__( $link['title'],'theme-my-login-custom' ) . '</a></li>' . "\n";

From plugins/theme-my-login-6.4/includes/class-theme-my-login-template.php file.

2. Re-scanned Theme my login plugin from WPML >> Theme and plugins localization page.

3. Then I visited WPML >> String Translation page and string was available for translation but it was assigned to wrong language, so that I had fixed this by selecting the ‘Contraseña Perdida’ checkbox and selected the new language e.g. Spanish from ‘Change the language of selected strings’ dropdown.

4. Then added English translation from WPML >> String Translation page.

And now it shows the correct translation as you can see in the attached screenshot.

Thank you

May 19, 2020 at 6:10 pm #6170863

Fabio Fava

Hello Noman,

First of all, changing plugin files will cause problems in the future, that's sure. Could you help me creating some kind of functions.php rule instead of changing a plugin original file? I can't understand why I have to make a change on a plugin file, WPML should be able to find that string in some way...

Just in case, I've done all the steps, copied the files youve changed to Live Site. I've had to stop at step 3 since I cannot find the string on the Live Site. I've done step by step exactly as you say, but seems that you've missed some instruction before step 3. There's no such "theme-my-login-custom" on the Live Site. No way to make it work

May 20, 2020 at 11:43 am #6177043

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I would recommend updating that plugin because maybe they already fixed this issue so it will work fine with wpml, or you may ask the plugin author to apply that change in his plugin files to make that string translation ready.

Could you please also try these steps:

1. Go to the WPML -> String Translation page and in the Auto register strings for translation section, enable the ‘Look for strings while pages are rendered’ option.

2. Re-visit the page on the front-end where the string appears:
hidden link

3. Re-visit the WPML -> String Translation page and search for that string.

4. Translate the string.

5. After translating the string, uncheck the auto-registration option.

Thank you

May 20, 2020 at 11:53 am #6177079

Fabio Fava

Hey Noman, thanks again for your help. I've already tried TML 7.x, but it not only doesn't fix that, but the new, changed logic, turns much more complicated to give me the results I want.

1. & 2. When I activate that option, I can only see the strings when I'm logged-in. But when I'm logged-in, it's impossible to view the Login page, since I'm already logged-in. So I can't see how this would help me. Please clear my view since I'm not seeing something you can see.

Since I can't see the page, thus I can't see the strings on the page, then I can't pass the very 1st step of your step-by-step. I'm sure I'm missing something, since you were able to do.

Maybe I just create the WPML Support user on the Live Site, then you go there and make the String appear? After you make it appear, I can takeover. Please just confirm the need of that change on that file of the plugin. May I replace for a default file after revealing the string or I should keep that changed file forever?

Thank you very much!

May 21, 2020 at 7:44 am #6184047

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

it's impossible to view the Login page, since I'm already logged-in
>> You can view the page in some other browser.

Maybe I just create the WPML Support user on the Live Site, then you go there and make the String appear?
>> Okay sure, I’ll enable a private input box for your next reply.

May I replace for a default file after revealing the string or I should keep that changed file forever?
>> You need to keep that file as previous code was not translation ready.

Thank you

May 21, 2020 at 8:11 am #6184315

Fabio Fava

Thanks to the great help of Noman, I've managed to find the needed strings and translate them. On the other hand, that modified file, I hope at some point WPML can find a way to "read" those strings ('Lost Password' and 'Login') in a way that those changes aren't needed. But Noman has been a Jedi Master, thanks!