"X Comments post" and "Leave a Reply" text – changeable?
Post count: 31fshihMay 26, 2016 at 3:51 am #20435
Hi Rai and team,
Is it possible to change the text that says “X No. of Comments post” and “Leave a Reply”? I tried to edit through the comments.php file but it looks like I can’t get rid of the word “post”.
I want to change it to say: “X comments” and “Leave a comment”
To get a better sense of what I’m referring to, please scroll down to the comments section on this page: http://yogawinetravel.com/how-to-get-the-most-out-of-your-visit-to-the-duomo-complex-in-florence-italy/#comments
FlorencePost count: 2683RaiMay 27, 2016 at 2:06 am #20437
Yes, you can use Loco Translate plugin to change that text. It is similar to preview topic here: http://support.jegtheme.com/forums/topic/subscribe-2/#post-14032 but you just need to search for “Comments” string or certain text you might want to change.
Thank youPost count: 31fshihMay 27, 2016 at 3:23 am #20438
Thanks for this! I downloaded the plugin and I’m not sure this solves my issue though as the word “posts” still shows up after “X Comments”. I edited the comments.php file and here is what the coding looks like:
<?php printf ( _n ( ‘Comments %1$s’, ‘%2$s Comments %1$s’, get_comments_number(), ‘jeg_textdomain’ ) , $post->post_type, number_format_i18n(get_comments_number()) ); ?>
This is what the text shows up as: 14 Comments post (please see http://yogawinetravel.com/how-to-get-the-most-out-of-your-visit-to-the-duomo-complex-in-florence-italy/#comments)
I also searched for “Reply” to try to change “Leave a Reply” –> “Leave a Comment” and the Loco Translate plugin does not show that string.
Is there a way to simply edit the .php files?
FlorencePost count: 2683RaiMay 28, 2016 at 1:37 am #20444
The plugin Loco Translate won’t work if the source string different (edited in .php file) even one bit, you must revert or Sync it in Loco Translate to update string you edited to be able work with translation plugin.
To remove “post” you just need remove the string “%1$s”, it can be done in Loco Translate.
Before “%2$s Discussion to this %1$s” After: “%2$s Comments”
For the “Leave a Reply” string it is came from default WordPress comment system, you need to update files in comments.php to be able translate it:
Go to line:34, you should find this code:PHP1<?php comment_form(); ?>
Replace with this code:PHP12345678910<?php$form_args = array('title_reply' => __( 'Leave a Reply', 'jeg_textdomain' ),'title_reply_to' => __( 'Leave a Reply to %s', 'jeg_textdomain' ),'cancel_reply_link' => __( 'Cancel Reply', 'jeg_textdomain' ),'label_submit' => __( 'Post Comment', 'jeg_textdomain' ),);comment_form( $form_args );?>
Please remember to Sync in Loco Translate after update it.
Thank youPost count: 7thebraidedlenaNovember 6, 2016 at 8:33 pm #22282
I’m wanting to change “Leave a Reply” to “Leave a comment” as well, but I’ve tried doing the coding mentioned above and it didn’t work. Do you know why this might be?!
ThanksPost count: 2683RaiNovember 7, 2016 at 2:45 am #22289
Could you elaborate what changes you have made? Please also provide your details: Falive Theme & Falive Plugin version and your site URL for further investigation.
Thank youPost count: 7thebraidedlenaNovember 7, 2016 at 8:51 pm #22296
I tried to change <?php comment_form(); ?> to the below coding
$form_args = array(
‘title_reply’ => __( ‘Leave a Reply’, ‘jeg_textdomain’ ),
‘title_reply_to’ => __( ‘Leave a Reply to %s’, ‘jeg_textdomain’ ),
‘cancel_reply_link’ => __( ‘Cancel Reply’, ‘jeg_textdomain’ ),
‘label_submit’ => __( ‘Post Comment’, ‘jeg_textdomain’ ),
comment_form( $form_args );
This coding hasn’t worked. Unfortunately my site is currently behind a “Coming Soon” page so you can’t view it, but I’m using Falive v1.1.1 in the Multi-purpose Fashion Blog Theme. Hope that helps.
Thank you!Post count: 2683RaiNovember 10, 2016 at 2:03 am #22308
For that changes, you don’t need to alter the code, that will require you to update the language files as well.
If you use the original theme file, you could change the file by using Loco Translate plugin as I mentioned above.
You must be logged in to reply to this topic.