Skip to main content
fixed question title
Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

Theme Localization How to translate theme content using site language?

Source Link

Theme Localization

I have theme. For example code for comments:

<?php
'fields'   =>  array(

'author' => '<p class="comment-form-author">' . '<label for="author">' . esc_html__( 'Name','text_domain' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' placeholder="'.esc_html__( 'Name','text_domain' ) .'"/></p>',

)
    ...
);
?>

I have changed site language in admin panel, but i still get 'Name' (english). How to translate theme content using site language?