Skip Navigation

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

Problem:
I translated a gravity form that uses range sliders created with the Gravity Forms Range Slider Add-On. The prefix and postfix descriptions of the range slider can't be translated.

Solution:
You can make the prefix and postfix strings available for translation with the following steps:

1. Add the following code to the functions.php file:

// WPML workaround for compsupp-7108
add_filter( 'gform_multilingual_field_keys', function ( $field_keys ) {
	$field_keys[] = 'prefix';
	$field_keys[] = 'postfix';
	return $field_keys;
}, 10, 2 );

2. Make a minor change to the original form and save it.
3. Send the form to translation and translate it, the strings should be available in the translation editor now.

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 10 replies, has 3 voices.

Last updated by Mohamed Sayed 12 months ago.

Assisted by: Mohamed Sayed.

Author Posts
December 2, 2023 at 9:25 am #14976923

antonW

Tell us what you are trying to do?
>On the homepage of cleanjack.be is a gravity form using range sliders.
>I translated the form, but there is no string for the postfix description of the range sliders

Is there any documentation that you are following?
> I follower the standard protocol for Gravity Form translations and also generated strings for all GF plugins

Is there a similar example that we can see?
> Seems like none of the postfix field is not picked up

What is the link to your site?
>hidden link

WPML Issue GF Range Slider postfix.png
December 3, 2023 at 4:21 pm #14980551

Mohamed Sayed

Hi Anton,
Thanks for contacting WPML support.

Please try this:

- Go to WPML String Translation
- Scroll down to the "Auto register strings for translation" section and enable that option
- Visit the page where the string is added on the front end
- Go back to String translation and disable the auto register option
- Search again for the string and translate it

Let me know please if that helps.

Kind regards,
Mohamed

December 4, 2023 at 1:01 pm #14986899

antonW

Hi Mohamed,

I tried the suggested approach, but the string is still not generated.

Please advise...

December 4, 2023 at 6:54 pm #14990817

Mohamed Sayed

This could be a compatibility issue with the Gravity Forms Range Slider addon.

I have created this clean sandbox setup on our servers here:
hidden link (one-click login)

I would need you to please set up WPML + the WPML add-ons as you have them on your site (they are already installed) and also install Gravity Forms + Gravity Forms Range Slider addon and try to recreate the issue.

Please don't migrate your site to the sandbox or install anything else like plugins that are not necessary, on a clean sandbox we try to use just the WPML plugins and the plugin/theme that's part of the issue.

If the issue is going to take place on this clean setup on our servers too, then I can check this with our compatibility department.

Please let me know how that goes and what you can find.

December 12, 2023 at 1:04 pm #15046165

antonW

Sorry for the delay, we had some priority issues to attend on our end.
Can you refresh the login link so I can replicate the issue in the sandbox?

December 12, 2023 at 5:02 pm #15048475

Mohamed Sayed

Hi,

Please use this link: hidden link

December 13, 2023 at 10:40 am #15053035

antonW

Thanks!
I installed gravity forms elementor and elementor ad ons.
Next I create a test page and test form.
Next step would be to install WPML for Gravity Forms and WPML String Translations, but I got an error on those during the WPML setup.

December 13, 2023 at 11:03 am #15053475

Mohamed Sayed

I installed "Gravity Forms Multilingual" and activated String Translation. Please let me once the issue is replicated.

December 20, 2023 at 9:31 am #15099739

antonW

I did the following steps to replicate the issue:
- translated the sliders page
- translated the gravity form
All fields show, except for the post-fix field: 'Postfix English'. The field also does not show as string.
Next I scanned the slider plugin for strings, the field does not show as string.
Next I auto register strings for translation and go to the slider page and change language, the field still does not show.

Please advise...

December 20, 2023 at 10:36 am #15100415

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Since Mohamed currently has a few days off, I will replace him here in the forum. I hope this is OK for you.

Thanks for replicating the issue. I've consulted our compatibility team and we will update you as soon as we get their reply.

Thanks,
Osama

December 27, 2023 at 2:03 pm #15132294

Mohamed Sayed

Thanks for your patience!

Please try the following workaround to fix this issue:

1. Add the following code to the functions.php file:

// WPML workaround for compsupp-7108
add_filter( 'gform_multilingual_field_keys', function ( $field_keys ) {
	$field_keys[] = 'prefix';
	$field_keys[] = 'postfix';
	return $field_keys;
}, 10, 2 );

2. Do a small modification on the original form and save it
3. Send the form to translation and translate it, the fields should be available now.

This works on the sandbox as you can see here: hidden link

Please note that the "Gravity Forms Range Slider Add-On" plugin is not listed on the WPML compatibility list for the plugins - https://wpml.org/plugin/.

Kindly contact the plugin authors and share the issue with them. We also suggest asking them to join our Go Global program, so they can collaborate with our compatibility team to make the plugin compatible with WPML.

They can join at this link: https://wpml.org/documentation/support/go-global-program/

Kind regards,
Mohamed