• Hello, OceanWP, I want to change the label_submit text into other word.
    I know I can edit comments.php file below

    comment_form(
    	array(
    		...
    	'label_submit' => esc_html__( 'Post Comment', 'oceanwp' ),
    		...
    	)
    );

    Just change 「Post Comment」to what I want. But now I use child-theme to edit, therefore it is useless edit comments.php under child-theme. Instead we should add some code in functions.php file.

    I have tried add_filter on hook like 「comment_form_fields」、「comment_form_default_fields」, and my code is like

    function yann_comment_form_fields($fields) {
        $fields['label_submit'] = esc_html__( '留言', 'oceanwp' );
        return $fields
    }
    add_filter('comment_form_fields','yann_comment_form_fields');

    maybe there is some mistake or misunderstanding of using this hook or $fields variable. Could you please help me point out how can I do.

    Thank you for your time.

    • This topic was modified 4 years, 10 months ago by yannyann.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @yannyann,

    If you want to translate the theme, you can use Loco Translate or Say What? plugins.

    The other solution would be to install Poedit software on your PC, edit or create a translation file for your language based on our translation template in the languages folder (don’t forget to update the strings before editing) and then place the translation in the child theme’s languages folder (if the folder doesn’t exist, create it).

    Hope this helps. Best of luck with your website

    Thread Starter yannyann

    (@yannyann)

    Humm, If I do not want to use Loco Translate or something else like translation plugin and do coding way, is there any other method to achieve this goal?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change Comment form submit label text’ is closed to new replies.