Skip Navigation

[Resolved] Cambiar nombre boton

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Mauricio Gonzalez 3 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1625551
2020-05-15 13_03_40-Mi cuenta - Carmen Borja Sitio Oficial.jpg

Tell us what you are trying to do?
Hola tengo un campo pra añadir una imagen a un formulario y queiro cambair el texto del botón.
Por defecto está en inglés "Upload or select image" y deseo cambairlo a "Seleccione la imagen"

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1625795

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Se parece que este texto falta su traducción.

Puedes usar el código siguiente para traducir el texto.

Debes editar la página (ó páginas) que tiene el formulario para solo intentar traducir el texto en páginas donde aparece.

/**
 * Translate "Upload or select image" text from Toolset Forms
 */
add_action( 'template_redirect', 'ts_translate_texts' );
function ts_translate_texts(){

	if ( is_page( 'add-thing' ) ){ // Editar

		add_filter( 'gettext', 'ts_translate_form_text', 10, 3 );
		function ts_translate_form_text( $translation, $text, $domain ){
			
			if ( $domain === 'wp-cred' && $text === 'Upload or select image' ){
				$translation = 'Seleccione la imagen';
			}
			
			return $translation;
		}
	}
}
#1626117

No consigo que funcione.
He añadido el código al plugin Woody snippets, para poder usarlo como un shortcode que he colocado en la página del formulario, pero no me funciona.

[wbcr_php_snippet id="11360"]
[cred_form form="devoluciones"]

#1628487

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

No conozco este plugin, pero si quieres usar en código en un shortcode, solo necesitas el parte interior del código arriba:

add_filter( 'get_text', 'ts_translate_form_text', 10, 3 );
function ts_translate_form_text( $translation, $text, $domain ){

    if ( $domain === 'wp-cred' && $text === 'Upload or select image' ){
        $translation = 'Seleccione la imagen';
    }

    return $translation;
}

Lo he probado en este formato tambien y funciona.

#1630545

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.