This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to translate registration information in the Blocksy-companion domain using WPML > String Translation, but the translation does not appear on the front end. Specifically, the message 'An account is already registered with your email address. Please log in.' remains untranslated. Solution: We recommend following these steps: 1. Revert any previous changes you made while attempting other workarounds. For details on reverting changes, you can refer to our forum post: https://wpml.org/forums/topic/registration-info-translation-issue/#post-15864965 2. Edit the file
Note the change in the file extension from '.mo' to 'mo'. ❌ IMPORTANT: Please ensure you backup your database and website before making these changes. ❌
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket at WPML support forum.
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.
Background of the issue:
I am trying to translate registration info in the blocksy-companion domain using WPML > String translation. There is a link to the screenshot: hidden link
Symptoms:
The translation has no effect on the front end. The message 'An account is already registered with your email address. Please log in.' remains untranslated.
Questions:
Why is the translation not appearing on the front end?
Hi!
On sandbox everything is OK! So I do not know what is going on...
1) I have installed WooCommerce.
2) In WooCommerce I have enabled: Settings > Accounts & Privacy > "Allow customers to create an account on the "My account" page".
3) I have switched to Child Theme.
4) Open the Polish version of the blog: hidden link
5) Click the person icon in the header to open a popup for logging in or registering.
6) Go to "Zarejestruj się" (Sign up) tab.
7) Register new a user.
8) You will see the correct translation.
1) I removed the "Your account was created successfully. Your login details have been sent to your email address. Please visit the %1$slogin page%2$s." from WPML > String translation.
2) I have pressed "Can't find the strings you're looking to translate?"
3) I have checked Blocky theme and Blocksy Companion plugin and pressed "Scan translation files"
4) I went to WPML > String translation again and found the deleted string and translated it.
5) Now it is OK
Now I will check if same procedure will fix my previous issue sent to you.
Unfortunately, it turned out that there is a problem all the time. Before the weekend, I didn't test it correctly.
It turned out that the correct translation can be seen on the front-end, but only when the "Look for strings while pages are rendered" option is enabled.
After turning it off, there is no proper translation. I have tested it many times.
I did not do it in the sandbox. It is on live blog.
Hi!
I have tested the same in the sandbox as well. And the same issue is there:
The correct translation can be seen on the front-end, only when the " Look for strings while pages are rendered" option is enabled.
After turning it off, there is no proper translation.
I see that issue on the sandbox site. The success registration message is loaded via Ajax so there could be an issue with the translation string. I suggest you use the action WooCommerce Account page instead of opening the modal and see if it helps.
"Hmm, I'm not entirely sure that WPML could work here, as this is a string that's defined in the core translation files, not the database. A string like this is usually recommended to be translated using a specialised tool, such as Loco Translate."
Using Blocksy support advice I have installed Loco Translate plugin:
1) I found a problematic string in Loco Translate > Plugins > Blocksy Companion.
2) I have translated it into Polish.
3) (Important!) I have relocated translations in Loco Translate > Plugins > Blocksy Companion:
from: System -languages/plugins/blocksy-companion-pl_PL.po
to: Custom - languages/loco/plugins/blocksy-companion-pl_PL.po
4) And now it works 🙂
I am very interested about your opinion about it. Can I leave it now?
As I mentioned, the success registration message string is different from other strings, it is loaded via Ajax. I'm asking our 2nd tier support about this issue and update you here when I have something to share.
// WPML Workaround for compsupp-7437
if ( class_exists('Sitepress') ) {
$string = $error_message;
$textdomain = 'WordPress';
$string_name = 'WPML Workaround : '.substr($string, 0, 20);
$wpml_default_lang = apply_filters('wpml_default_language', NULL );
$wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
if ($wpml_default_lang == $wpml_current_lang ) {
do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
}
// Apply the translation to the string
$string = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
$error_message = $string; // Replace the title
}
$errors->add('registered', $error_message, 'message');
3.Visit the front-end and try to register a new user in the default language.
4. Go to WPML > String Translation > Translate the new string under the domain WordPress.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
Thanks for your confirmation. Our compatibility team will also inform the theme author about this issue and workaround to fix it. Your co-operation will push things faster.
Feel free to open a new ticket if you have more questions.
Our 2nd tier support also suggest you use another workaround, that would be applied to other similar cases. Please follow steps below and let me know if it helps:
notice the file extension (.mo -> mo).
❌ IMPORTANT: Please backup your database and website before proceeding ❌
Looking forward to your reply.
Thanks
grzegorzK-16 confirmed that the issue was resolved on 2024-07-17 07:54:07.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.