How to localise this string (including html) ?
echo "<div class='updated'><p>All options are restored successfully.</p></div>" ;
Is this correct?
echo '<div class="updated"><p>' . __( 'All options are restored successfully.', 'mytextdomain' ) . '</p></div>';
And how to go about this one?
<p><?php _e( 'On the <a href="' . get_admin_url() . 'import.php">Import</a> page, choose the previously created file and click the <strong>Upload file and import</strong> button.', 'mytextdomain' ); ?></p>
__()
, if you want to echo, use_e()
. So,_e()
is exactly the same asecho __()
.