- This topic has 3 replies, 2 voices, and was last updated 6 years, 11 months ago by Mahesh.
-
AuthorPosts
-
May 2, 2017 at 5:11 am #115093LangloisParticipant
HI,
I use Lucida Pro and I need to translate “leave a comment”
Thanks for your answer.
jeanmarcMay 2, 2017 at 7:16 am #115099MaheshKeymaster@jmlan: Thank you for using Lucida Pro. The theme doesn’t have any translation file yet so that’s why no translation. The translation can be achieved in two ways.
1. Make the translation file (.po and .mo files) ( as Contribution )
2. Override the function and use the french translated string for “Leave a comment”
For option 2.
You’ll need to create a child theme. You can find more details on creating child theme HERE. Then in your child theme’sfunctions.php
add the following CSS:function lucida_entry_meta() { echo '<p class="entry-meta">'; $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); printf( '<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">%3$s</a></span>', sprintf( _x( '<span class="screen-reader-text">Posted on</span>', 'Used before publish date.', 'lucida-pro' ) ), esc_url( get_permalink() ), $time_string ); if ( is_singular() || is_multi_author() ) { printf( '<span class="byline"><span class="author vcard">%1$s<a class="url fn n" href="%2$s">%3$s</a></span></span>', sprintf( _x( '<span class="screen-reader-text">Author</span>', 'Used before post author name.', 'lucida-pro' ) ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ); } if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) { echo '<span class="comments-link">'; comments_popup_link( esc_html__( 'Laissez un commentaire', 'lucida-pro' ), esc_html__( '1 Comment', 'lucida-pro' ), esc_html__( '% Comments', 'lucida-pro' ) ); echo '</span>'; } edit_post_link( esc_html__( 'Edit', 'lucida-pro' ), '<span class="edit-link">', '</span>' ); echo '</p><!-- .entry-meta -->'; }
Regards,
MaheshMay 2, 2017 at 9:03 am #115104LangloisParticipantThanks, it woks for the one at the bottom of an article.
But there is a “leave a comment” in the top juste after the title, the date, the author of each article.Did I miss something ?
Thank you
jean-marc
May 3, 2017 at 12:03 am #115155MaheshKeymaster@jmlan: Its working fine on mine. Check the image in the link below:
http://bit.ly/2oWkOhp
Please post in your site url.Regards,
Mahesh -
AuthorPosts
- The topic ‘Translate "leave a comment" in french’ is closed to new replies.