Skip Navigation

Este es el foro de soporte técnico de WPML, el plugin multilingüe de WordPress.

Todas las personas pueden leerlo pero solo los clientes de WPML pueden ingresar comentarios. El equipo de WPML responde en los foros 6 días a la semana, 22 horas por día.

Hoy no hay asistentes de soporte disponibles en el foro Spanish. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

This topic contains 56 respuestas, has 3 mensajes.

Last updated by Andrés hace 1 year, 7 months.

Assigned support staff: Andrés.

Autor Mensajes
octubre 9, 2018 a las 8:08 am #2798802

OscarO-3

Gravity Forms support answer:

Those strings are not translated because they are totally editable. The link text can be edited in form settings, the email notification in notifications settings and the confirmation and the form text can be edited in confirmations.

octubre 9, 2018 a las 8:49 am #2799003

Sumit
Supporter

Languages: Inglés (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thanks! This is not what we want. I meant any hook/filter which can alter the text on front-end?
Anyway, I am checking again with the team for the temporary solution.
I will update you again.

Thanks

octubre 9, 2018 a las 9:01 am #2799037

OscarO-3

Yep, I know, I asked for a specific filter / hook (actually, I copied / pasted part of your answer).

I writed them again explaining that those problematic strings are translated, the problem is that are not being displayed in the front-end because we have not find any filter / hook to achieve this.

I'll keep you posted in case of any interesting news from Gravity Forms Support.

I'm looking forward for your temporary solution!! 🙂

Thanks,

octubre 9, 2018 a las 10:48 am #2799551

Sumit
Supporter

Languages: Inglés (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

I check the code again and prepared a solution using a filter which is being run for almost all text in Gravity Forms. I added many conditions to alter the text only to save and continue confirmation and seems work for now.

Please add this code to your theme functions.php and translate the confirmations text then let me know if it works

add_filter('gform_pre_replace_merge_tags', function ($text, $form){
    
    if (empty($form['id']) || empty($form['confirmation'])) {
	return $text;
    }
    
    if ( !empty($_POST['gform_send_resume_link']) || !empty($_POST['gform_save']) ) {
	$form_id = $form['id'];
	$confirmation_name = preg_replace( '/[ \[\]]+/', '-', 'field-confirmation-message_' . $form['confirmation']['name'] );
	
	$translated_text = icl_t("gravity_form-{$form_id}", $confirmation_name, $text);
	
	if (strpos($text, 'form_saved_message_sent') !== false && strpos($translated_text, 'form_saved_message_sent') === false) {
	    $translated_text = '<div class="form_saved_message_sent"><span>' . $translated_text . '</span></div>';
	}
	
	return $translated_text;
    } 
    
    return $text;
    
},10,2);

Thanks

octubre 9, 2018 a las 11:55 am #2799819

OscarO-3

Hi again, Sumit, and thanks for your help,

I've tried the solution provided by you in one Form and seems that the texts in english are being now displayed, but the format (line breaks and bolds) are getting lost and some internal variables are displayed as a plain text (see screenshots attached).

Is there any way to keep the HTML format of the strings?

The website is composed for about one hundred forms, and I need to check that everything continues working fine and also that all the save and continue functionility in these Forms are working properly.

So, I would like to ask you to keep the ticket opened until I finish with these testings.

If everything it's OK, I'll proceed to close the ticket.

Thanks again for your help and support,

octubre 11, 2018 a las 11:50 am #2807991

Sumit
Supporter

Languages: Inglés (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thanks for the feedback.

In my testing, I see {save_email} placeholder is replaced with an actual email address. And can you please elaborate the what do you mean by bad HTML format?

Both issues can be related to how you have translated the strings, maybe just check both strings are formatted correctly in string translation and are okay?
If this is not the case then I will take a look at the website.

Thanks

octubre 11, 2018 a las 1:18 pm #2808333

OscarO-3

Hi Sumit,

Answering to your comments and questions:

1) I'm unable to see the corresponding email address in the screen2.gif attached. I'm always getting {save_email} as a plain text instead of the email address introduced in the screen1 input

2) About bad HTML format, basically, all the break lines are lost in the translations of this string. I've edited all the strings related to this screen inserting manually < br > tag and the problem is fixed, but it is weird because all the other strings that are being correctly displayed (confirmations after sent the Forms) are displaying the HTML without problems and without the need of insert < br > tag manually in the translations. So I guess that it's a focused problem in these strings because is not being happening in the rest of Form translations.

Summarizing, I have the problem 2 fixed and the problem 1 it's not a critical issue because I can reformulate the message without the email address.

Anyway, it would be very appreciated a proper solution of these 2 problems just in case I need to face them in the future without current flexibility.

Regarding to this future, the main concern is that you have provided me with a temporary solution (or trick) but, when will be this problem fixed in the standard Gravity Forms Multilingual updates? I mean, is it scheduled to fix this problem in the future? Will I be notified in any manner?

If you need to take a look to the website, you can find access details in this ticket (attached in the first message).

Thanks in advance for your help and best regards,

octubre 12, 2018 a las 2:10 pm #2812262

Sumit
Supporter

Languages: Inglés (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Sorry I did not notice this earlier. Please replace the previous code with this update one

add_filter('gform_pre_replace_merge_tags', function ($text, $form){
    
    if (empty($form['id']) || empty($form['confirmation'])) {
	return $text;
    }
    
    if ( !empty($_POST['gform_send_resume_link']) || !empty($_POST['gform_save']) ) {
	$form_id = $form['id'];
	$confirmation_name = preg_replace( '/[ \[\]]+/', '-', 'field-confirmation-message_' . $form['confirmation']['name'] );
	
	$translated_text = icl_t("gravity_form-{$form_id}", $confirmation_name, $text);
	
	if (strpos($text, 'form_saved_message_sent') !== false && strpos($translated_text, 'form_saved_message_sent') === false) {
	    $translated_text = '<div class="form_saved_message_sent"><span>' . $translated_text . '</span></div>';
	    if (isset($_POST['gform_resume_email']) && GFCommon::is_valid_email( $_POST['gform_resume_email'] )) {
		$email_esc = esc_attr( $_POST['gform_resume_email'] );
		$translated_text = str_replace( '{save_email}', $email_esc, $translated_text );
	    }
	}
	
	if ($text != $translated_text) {
	    return nl2br($translated_text);
	}
	
	return $translated_text;
    } 
    
    return $text;
    
},10,2);

It should fix the issue.

Regarding the real fix, for sure we will update you once that is fixed in the future version of Gravity form Multilingual.
You can leave this ticket as it is and we will keep you posted. But please allow us some time to develop the better fix and this may take some time, therefore, we have developed this hotfix for you.

Thanks

octubre 15, 2018 a las 5:24 pm #2818446

OscarO-3

Hi Sumit,

Thanks for this hotfix and also for your help and support.

I'll do, I'm going to use it until the definitive solution will be released and I'm also going to leave the ticket as it is following your instructions.

Andrés, si todavía lees estos mensajes, gracias a ti también por tu ayuda durante estas semanas.

Cheers and thanks again,

enero 23, 2019 a las 10:45 am #3120079

Andrés
Supporter

Languages: Inglés (English ) Español (Español ) Francés (Français )

Timezone: Europe/Paris (GMT+02:00)

¡Hola de nuevo! 🙂

La última versión del paquete WPML debería haber resuelto esta situación. ¿Podrías hacer un backup complete de tu sitio y hacer la actualización?

¿Resuelve tu problema?

Saludos

enero 23, 2019 a las 3:00 pm #3121145

OscarO-3

Hola Andrés,

¡Y feliz año con retraso! :p

Actualicé la versión de Gravity Forms Multilingual hace unos días y comprobé que se habían resuelto todos los problemas menos uno.

Las notificaciones por correo no se traducían, pero agregando la solución que me pasaste en este enlace https://wpml.org/es/forums/topic/funcionalidad-save-and-continue-no-se-traduce-gravity-forms/page/2/#post-2749252 el problema se solucionaba.

Es lo único, aunque, como te digo, lo he podido solucionar gracias a este truco que me pasaste.

De hecho, hace meses que el equipo de desarrollo me pasó una solución temporal y con ella lanzamos el producto.

Gracias y saludos!

enero 23, 2019 a las 3:30 pm #3121264

Andrés
Supporter

Languages: Inglés (English ) Español (Español ) Francés (Français )

Timezone: Europe/Paris (GMT+02:00)

¡Me alegra saber que has podido lanzar tu sitio! 🙂
Que tengas un buen día y no dudes en abrir un nuevo ticket si necesitas más ayuda.