Internationalization of strings with html tags and numbers in WordPress

You can wrap the translation in a printf function. printf ( or sprintf for when you don’t want to print to the screen immediately ) allow you to put placeholders in the string. See the documentation for all the type specifiers

Use __() instead of _e() because printf already outputs to the screen.

$no_people = 5;

printf( __( 'There are %d <span>people</span> in this country.', 'textdomain' ), $no_people );

Edit

Added example for wp_localize_script

$no_people = 5;

$nostores = sprintf( __( 'There are %d <span>people</span> in this country.', 'textdomain' ), $no_people );

wp_localize_script( 'store-locator', 'storelocatorjstext', array(
    'nostores'   => $nostores
) );

tech