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>
Your example is correct, simply because it works. There are hundreds of ways to localize strings wich are displayed including html, all good and elegant in their own way.
I like to do this as follows:
You also could do this like:
The most important thing is to maintain readability I guess. There isn’t a “correct” way to display localized strings in combination with html.
For your second one, I would use:
In this case, the URL doesn’t have to be translated.