Wrap your translation function in php printf function and use %1$s, %2$s…
$myvariable = 'something'; $myvariable2 = 'something2'; printf(esc_html__('My translation text for %1$s and %2$s', 'textdomain'), $myvariable, $myvariable2);
If you need to translate with working html tags use
printf(wp_kses(__('my <strong>translation</strong> for %1$s and %2$s', 'textdomain'), array('strong' => array())), $myvariable, $myvariable2);