[Resolved] Como cambio el idioma en la sección comentarios del blog

Home Forums Support [Resolved] Como cambio el idioma en la sección comentarios del blog

Home Forums Support Como cambio el idioma en la sección comentarios del blog

  • This topic has 3 replies, 2 voices, and was last updated 3 years ago by Elvin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1699567
    mendoza

    Deseo cambiar el idioma de DEJE SU COMENTARIO, nombres, website, email. Uso un tema hijo. Gracias
    child

    #1699721
    Elvin
    Staff
    Customer Support

    Hi there,

    Have you sorted this out? I’ve checked your site and it seems to be translated already as shown here:
    https://share.getcloudapp.com/v1uNZdOE

    For the placeholder, you’ll need add_filter( 'comment_form_default_fields',function(){ ... }));

    Example:

    add_filter( 'comment_form_default_fields',function($fields){ 
    	$commenter = wp_get_current_commenter();
    	$required = get_option( 'require_name_email' );
    
    	$fields['author'] = sprintf(
    		'<label for="author" class="screen-reader-text">%1$s</label><input placeholder="%1$s%3$s" id="author" name="author" type="text" value="%2$s" size="30" />',
    		esc_html__( 'Nombre', 'generatepress' ),
    		esc_attr( $commenter['comment_author'] ),
    		$required ? ' *' : ''
    	);
    
    	$fields['email'] = sprintf(
    		'<label for="email" class="screen-reader-text">%1$s</label><input placeholder="%1$s%3$s" id="email" name="email" type="email" value="%2$s" size="30" />',
    		esc_html__( 'Correo Eléctronico', 'generatepress' ),
    		esc_attr( $commenter['comment_author_email'] ),
    		$required ? ' *' : ''
    	);
    
    	$fields['url'] = sprintf(
    		'<label for="url" class="screen-reader-text">%1$s</label><input placeholder="%1$s" id="url" name="url" type="url" value="%2$s" size="30" />',
    		esc_html__( 'Website', 'generatepress' ),
    		esc_attr( $commenter['comment_author_url'] )
    	);
    
    	return $fields;
    }, 15, 1);

    You basically change the value in esc_html__( 'your translation', 'generatepress' ) for each field.

    #1700586
    mendoza

    Muchas gracias. Me sirvió su orientación!

    #1704332
    Elvin
    Staff
    Customer Support

    No problem. 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.