Skip to content Skip to sidebar

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

Problem:
WPML ignores Elementor TEXT fields that contain numbers

Solution:
See this https://wpml.org/forums/topic/wpml-ignores-elementor-text-fields-that-contain-numbers/#post-14722599 for details.

Relevant Documentation:

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 4 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 9 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
November 1, 2023 at 1:47 pm #14707933

yuryT-3

Related documentation: https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/

I am trying to: register a widget and both its fields:
..."settings":{"mailchimp_pre_form":"1389","heading":"Heading Title"}

I expected to see: the "mailchimp_pre_form" field in the list, and it does appear when I enter at least one letter in the field, but nothing works with numbers as in the example above.

Instead, I got: nothing

November 2, 2023 at 11:47 am #14715899

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Hi,

Thank you for contacting the support.

Can you please explain about the following?

...it does appear when I enter at least one letter in the field, but nothing works with numbers as in the example above.

A screenshot or screen recording 'll be helpful also.

Besides this, for the Form ID you can get it from MC4WP -> Forms -> Use the language switcher in the top header and switch the language.

I'll also suggest to check this guide https://wpml.org/documentation/related-projects/mailchimp-for-wordpress-multilingual/ for more details.

Please let me know and I'll try my best to help you further on the matter.

Regards.

November 2, 2023 at 1:07 pm #14716899

yuryT-3

Hi, you are being lazy, lol. WPML doesn't work with integers in any TEXT field. Well, here are a couple of screenshots that show how it works. And it does not show that field in WPML editor at all when I leave only the number there.

wpml-bug.png
November 3, 2023 at 3:12 am #14722007

yuryT-3

Well, I experimented for a while and I'm pretty sure WPML just copy such fields. It makes sense at some point but not in the case when I explicitly specify them in the settings.

It would be helpful if you relaxed that restriction. It's not rare when themes and plugins are unaware about WPML even when they declare supporting it.
BTW, you might want to report this quite popular theme due to false advertising 😉
hidden link

Anyway, since I have to modify my theme anyway, I found a better workaround based on wpml_object_id filter. So you are free to close this ticket if you don't want to deal with it.

November 3, 2023 at 6:44 am #14722599

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

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

Thank you for the details. I discussed this with the team and there are following possibilities at the moment:

A) Only numbers/integers as values won't show up in ATE but you as a workaround, it’s possible to enable numbers by adding the following code to the functions.php file:

/**
 * Allow translating numbers
 * @see https://wpml.org/forums/topic/wpbakery-post-grid-element-exclude-from-filter-list-category-reappears
 */
function wpmlsupp_7499_allow_translating_numbers( $is_translatable, $job_translate ) {
    $data = $job_translate['field_data'];
	if ( 'base64' === $job_translate['field_format'] ) {
		$data = base64_decode( $data );
	}
    if ( is_numeric( $data ) ) {
    	return true;
    }
    return $is_translatable;
}

add_filter( 'wpml_tm_job_field_is_translatable', 'wpmlsupp_7499_allow_translating_numbers', 10, 2 );

B) Alternatively, you can translate the number/integer values manually by switching to other language from top admin bar, after opening the original content for editing in the default language first (as mentioned earlier).

C) You can also try searching for this in WPML -> String Translation and translate accordingly.

Given that, can you please try these if you prefer and see if this work for you?

P.S.: There have been reports about such cases previously and unfortunately there's no other work around than the proposed above (so far).