Over the previous posts I've discussed adding text domains and which functions are available to use, it's time to look at a practical application.
To return a translated string we'd use the
esc_html__ function with the string which can be localized as the first parameter and the text domain as the second:
$str = esc_html__('This is the string to translate', 'plugin-text-domain');
If we wanted to echo the translated string rather than return it, we'd use the
esc_html_e('This is the string to translate', 'plugin-text-domain');