Strings including html for localisation

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:

printf( '<div class="updated">
        <p>%1$s</p>
    </div>',
    __( 'All options are restored successfully.', 'mytextdomain' )
);

You also could do this like:

$str = __( 'All options are restored successfully.', 'mytextdomain' );
echo "<div class="updated"><p>$str</p></div>";

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:

_e( sprintf( 'On the <a href="https://wordpress.stackexchange.com/questions/85532/%1$s">Import</a> page, choose the previously created file and click the <strong>Upload file and import</strong> button.', get_admin_url() . 'import.php' ), 'mytextdomain' );

In this case, the URL doesn’t have to be translated.

tech