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.

This topic contains 12 replies, has 2 voices.

Last updated by ursK-3 2 months, 1 week ago.

Assigned support staff: Marcos Vinicios Barreto.

Author Posts
November 25, 2020 at 4:33 pm #7527423

ursK-3

I am trying to:
Translate a Gravity Form from my main language German to Englisch etc.

There is a really strange bug, if I go to WPML -> String Translation and select the domain from my gravity form all the field label and description are set to German as main language. But all post_custom_field are linked to Englisch (have a look at my attachment).

If I manually set the default language to german and make some changes to the form all translations are gone and also the fields are in englisch again.

How is that possible?

If I create a new form this problem does not happen. But I can't rebuild it again, it's huge..

November 26, 2020 at 7:37 am #7531871

ursK-3

I saw that my memory limit was very low, I updated this setting to 512MB but same problem.

November 27, 2020 at 12:36 am #7538165

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you contacting our support service. It is hard to determine what's going on without a detailed investigation. How are the 'post_custom_field' setup? Does it get content from an existing post? if so, what's the original language of these posts? Also, when you manually change the default language of these custom fields to german, are you editing the form in german or english? Maybe you changed language in some way when editing it.

I would appreciate if you could reproduce the issue while recording your screen, it will help me to understand the details of your issue. You can use this tool hidden link for this task.

Please, let me know the requested details, so, we can move forward on the issue investigation and resolution. Thank you for your collaboration, have a nice day.

November 27, 2020 at 7:54 am #7540511

ursK-3

Thanks for your answer.
No, it don't get content from an other post.

I made a screen record: hidden link

My workflow:
- The form ID is 13
- You can see there are some fields in german and some in english
- I change them to german and add the translation
- Everything works as expected
- Then I update the form (made no changes)
- All settings are gone, the fields are in englisch again.

November 27, 2020 at 6:30 pm #7546353

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Please, take a look at my previous private reply and let me know when the migration process is done. Thanks.

November 30, 2020 at 10:42 am #7558265

ursK-3

Many thanks for your efforts!
The migration is done. Please test with the form "Reparatur Anmeldung" (ID 10) because I deleted form 13.

December 2, 2020 at 12:55 am #7574707

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the details. I tried to replicate the same issue with the mentioned form but I don't see any issue when doing so. Here are the details of my tests:

1 - I browsed the translated page where the form appears at: hidden link. The strings keep appearing in german as default language properly.

2 - Then, I clicked to update the form from the form settings. The strings keep appearing in german as default language properly.

A possible explanation for your issue: You are registering the strings using the 'Look for strings while pages are rendered' option from the english page where the form appears.

Doing so, you are forcing WPML to register these strings in the language they are being scanned (english) in this case.

Instead of registering Gravity Forms strings using this method, you should make it with the recommended form which is by saving the contact form from the form settings and then browsing the registered text domain gravity_form-ID from the WPML String Translation settings.

In short, the form saving action is what should be done to register the strings in the correct language.

See: https://wpml.org/documentation/related-projects/gravity-forms-multilingual/

Please, let me know if it helps to solve your issue. Have a nice day.

December 2, 2020 at 8:04 am #7576963

ursK-3

Thanks for you input but this is not the problem...
I saw this url: https://wpml.org/documentation/related-projects/gravity-forms-multilingual/ already and this causes the same issue.
The problem only exists in this old forms. If I delete the form and build a new one it works. So my workflow can't be wrong.

Please try this:
- Translate these options as (see my attachment)
- Update the form with an additional field
- The translation will be gone.
- Do you have a admin login for the testing site, that I can show you if can't reproduce..?

December 3, 2020 at 1:21 am #7582741

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Please, take a look at my previous private reply and let me know the results once you are done. Thanks.

December 3, 2020 at 8:06 am #7584603

ursK-3

I tried it as you said... the same issues:
Here are two videos:
Video 1: hidden link
Video 2: hidden link

What you can see in video 1:
- You can see that the highlights option "Kein Zubehör" is not translated.
- I send the form to the translation backup
- "Kein Zubehör" is not in the list so it is not possible to translate.

What you can see in video 2:
- You can see that the highlights option "Kein Zubehör" is not translated in the "String Translation".
- I activate "Look for strings while pages...."
- Then the "Kein Zubehör" shows up as "English" --> wrong --> I change it to german
- I update the form --> the "Kein Zubehör" is gone again.

If I repeat these steps with a form made new, there are no problems only with this form.

December 4, 2020 at 7:14 pm #7596781

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the clarifications, got the point now. I tried to register the strings in the mentioned checkbox fields using several methods, but in all of my tests as soon as the form settings are updated, the registered strings are gone. I am forwarding this ticket to our second level team for a detailed investigation, I will update you here as soon as some more details are provided.

Thank you for your understanding and patience, have a nice day.

December 17, 2020 at 12:26 am #7681337

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for your patience. According our second level support, the issue is related to the field type being used in your form which are a post field type. Do you have any specific reason to use this type of field or it was added by mistake? If you are using the post field type in your form intentionally, then you can try this workaround:

IMPORTANT: Please, note, a backup is required for security reasons and to avoid any data loss, you can use the https://wordpress.org/plugins/backupwordpress/ plugin for these backup needs.

Edit the file \plugins\gravityforms-multilingual\inc\gfml-tm-api.class.php line number 234, then replace:

protected function register_strings_field_post_custom( $form_package, $form_field ) {
		// TODO if multi options - 'choices' (register and translate) 'inputType' => select, etc.
		$this->register_string_field_property( $form_package, $form_field, 'customFieldTemplate', 'get_field_post_custom_field' );
	}

With:

protected function register_strings_field_post_custom( $form_package, $form_field ) {
		// TODO if multi options - 'choices' (register and translate) 'inputType' => select, etc.
		if (in_array($form_field->inputType, ['radio', 'select', 'multiselect', 'checkbox', 'list'])) {
			$this->register_strings_field_option( $form_package, $form_field );
		}
		$this->register_string_field_property( $form_package, $form_field, 'customFieldTemplate', 'get_field_post_custom_field' );
	}

Now, you should be able to register these fields to be translated with WPML String Translation as you would do with any other field. Please, let me know the results, have a nice day.

December 17, 2020 at 8:12 am #7683253

ursK-3

My issue is resolved now. Thank you!