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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by Long Nguyen 3 days, 17 hours ago.

Assisted by: Long Nguyen.

Author Posts
June 21, 2024 at 9:02 am #15772340

grzegorzK-16

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?

June 21, 2024 at 10:20 am #15773858

grzegorzK-16

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.

Grzegorz

correct translation.jpg
June 21, 2024 at 1:07 pm #15775459

grzegorzK-16

Hi!

I fixed it :)!!!

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.

Grzegorz

it is OK.jpg
June 24, 2024 at 1:31 am #15799867

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Thanks for sharing the solution. Let me know if it works on your live site.

Thanks.

June 24, 2024 at 10:35 am #15805652

grzegorzK-16

Hi!

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.

regards,
Grzegorz

still issue.jpg
June 24, 2024 at 12:09 pm #15806736

grzegorzK-16

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.

regards,
Grzegorz

still issue 2.jpg
June 25, 2024 at 2:33 am #15814030

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

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.

Looking forward to your reply.
Thanks

Customize: Sandbox – Just another WordPress site 2024-06-25 09-28-57.png
June 25, 2024 at 7:54 am #15817712

grzegorzK-16

Hmmm.... 🙂

Other string is translated without any problem. So, displaying the success registration message should work correctly as well.

Thanks,
Grzegorz

signup-info.jpg
June 25, 2024 at 3:00 pm #15822313

grzegorzK-16

Hi!

I am pasting info from Blocksy support:

"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?

regards,
Grzegorz

now is ok.jpg
June 26, 2024 at 3:14 am #15828120

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

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.

Thanks.

June 26, 2024 at 8:02 am #15830966

grzegorzK-16

I see. So I'm looking forward to the solution.
Thank you!
Grzegorz

July 1, 2024 at 4:07 am #15864965

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I got a workaround from our 2nd tier support to translate the success registration message string. Please follow steps below:

1. Open .../wp-content/plugins/blocksy-companion/framework/features/account-auth.php file.

2. Look for line 247, replace the code:

$errors->add('registered', $error_message, 'message');

with this one:

// 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 ❌

Looking forward to your reply.
Thanks

July 1, 2024 at 10:16 am #15867686

grzegorzK-16

Hi!
Thank you very much for the workaround. It works properly! 🙂

But the workaround key is to modify something in the Blocksy Companion plugin.
So after actualization, it will stop working.

So I have sent it to Blocksy support. I am waiting for their answer.

I will let you know as soon as I get it.

regards,
Grzegorz

July 2, 2024 at 1:18 am #15871151

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

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.