Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
Elementor widget not translating properly is the Counter widget. I see the 'prefix' field in the ATE but the 'ending_number' and 'suffix' fields are no where to be found.

Solution:
in : wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translatable-nodes.php
Change from:

if ( ! is_string( $string_value ) ) {

to:

	if ( ! is_string( $string_value ) && ! is_numeric( $string_value ) ) {

in: wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translatable-nodes.php
Change from:

if ( is_string( $stringInFlatField ) ) {
							$element = Obj::assocPath( $pathInFlatField, $string->get_value(), $element );
						} elseif ( is_string( $stringInArrayField ) ) {
							$element = Obj::assocPath( $pathInArrayField, $string->get_value(), $element );
						}

to:

if ( is_string( $stringInFlatField ) || is_numeric($stringInFlatField)) {
							$element = Obj::assocPath( $pathInFlatField, $string->get_value(), $element );
						} elseif ( is_string( $stringInArrayField ) || is_numeric($stringInArrayField)) {
							$element = Obj::assocPath( $pathInArrayField, $string->get_value(), $element );
						}

Relevant Documentation:

0% of people find this useful.

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.

Tagged: 

This topic contains 11 replies, has 2 voices.

Last updated by edgardC-2 1 year, 11 months ago.

Assisted by: Kor.

Author Posts
March 9, 2023 at 5:04 pm #13209869

edgardC-2

It just took a long while for the translated images to show, but these appear to be working now, thank you!!

Another Elementor widget not translating properly is the Counter widget. I see the 'prefix' field in the ATE but the 'ending_number' and 'suffix' fields are no where to be found.

hidden link
hidden link

March 10, 2023 at 9:39 am #13215357

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for your reply.

Sorry, your Website login credentials are removed when you marked your previous ticket as resolved. Could you share it here again so that I could check on it?

Thanks!

Kor

March 13, 2023 at 3:05 pm #13234171

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for your reply.

I've added the custom XML configuration here hidden link and it should work now. Please check.

Thanks!

Kor

Screenshot 2023-03-13 at 11.04.18 PM.jpg
March 13, 2023 at 5:20 pm #13235581

edgardC-2

This makes the suffix show up, but the number doesn't. That field is 'ending_number' but even if I add that to the custom XML configuration, it still doesn't show in the ATE.

March 14, 2023 at 6:22 am #13239029

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for your reply.

I've checked and it looks like it's not translatable. You can do this manually while I forward this to our 2nd Tier Support for further assistance.

Is there anything else besides this?

Thanks!

Kor

March 14, 2023 at 7:51 pm #13246323

edgardC-2

No, that's all

March 16, 2023 at 7:47 pm #13264085

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for your patience.

I've opened a report and our 2nd Tier Support will look into this for you.

I will come back to you once I've feedback.

Thanks!

Kor

March 20, 2023 at 8:09 pm #13287895

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for your patience.

Just letting you know that our 2nd Tier Support is still checking on this and I will come back to you once I've feedback.

Thanks!

Kor

March 22, 2023 at 6:15 am #13299955

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for your patience.

Our 2nd Tier Support checked, and they mentioned that including numbers in a translation job is incorrect. So the proper workflow for that would be to use a translation editor and adjust the translation manually with the Elementor's editor.

Thanks!

Kor

March 22, 2023 at 6:38 pm #13308187

edgardC-2

That workflow wouldn't make sense because that would override the translations and it would no longer be synced to the original page.

So the ATE can't handle translating fields that are numbers?

March 23, 2023 at 7:35 am #13311669

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for your reply.

WPML can translate numbers but usually for shortcode related such as the ID parameter.

Translating numbers on an Elementor module is not available and for your case, the "Counter" widget, you can use this workaround below.

However, it is not recommended since every update will replace the workaround code. But if you insist, you can try the following.

in : wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translatable-nodes.php
Change from:

if ( ! is_string( $string_value ) ) {

to:

	if ( ! is_string( $string_value ) && ! is_numeric( $string_value ) ) {

in: wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translatable-nodes.php
Change from:

if ( is_string( $stringInFlatField ) ) {
							$element = Obj::assocPath( $pathInFlatField, $string->get_value(), $element );
						} elseif ( is_string( $stringInArrayField ) ) {
							$element = Obj::assocPath( $pathInArrayField, $string->get_value(), $element );
						}

to:

if ( is_string( $stringInFlatField ) || is_numeric($stringInFlatField)) {
							$element = Obj::assocPath( $pathInFlatField, $string->get_value(), $element );
						} elseif ( is_string( $stringInArrayField ) || is_numeric($stringInArrayField)) {
							$element = Obj::assocPath( $pathInArrayField, $string->get_value(), $element );
						}

Let me know how it goes.

Thanks!

Kor

March 23, 2023 at 5:10 pm #13317757

edgardC-2

That's okay, I don't want to overwrite the module. Thank you, anyway.