Using esc_attr function

Remember to have the text domain along with the render functions (echo function).
It means that, they should be:

esc_attr_e("Text needing to be translated","your_text_domain");<br>
esc_attr_x("Text needing to be translated","your_text_domain");<br>
___("Text needing to be translated","your_text_domain");