Translating form labels shortcode output

If anyone is looking for a solution, here is a way (probably not the better one) to achieve it:

add_filter('widget_text', 'filtering_form_labels');
function filtering_form_labels($html) {

    if ( ICL_LANGUAGE_CODE=='en' ) {/*ICL_LANGUAGE_CODE used in WPML to know the active language*/
        $esp = array('Nombre', 'Apellidos', 'Suscribirse'); /*Array with words to be replaced*/
        $eng = array('First Name', 'Last Name', 'Subscribe'); /*Array with new words*/
        ob_start();
        $html = str_replace($esp, $eng, $html);
        ob_end_clean();
    }

    return $html;
}