Translate Phone number error message in Fluent Forms

Author: Aleš Sýkora, 15. 4. 2021

If you want to translate the error message, when user fill in wrong phone number in fluent forms, you can use this custom snippet:

add_filter('fluentform_editor_init_element_phone','changeErrTxt',10,1);
function changeErrTxt($element){
    $element['settings']['validation_rules']['valid_phone_number'] = [
        'value'   => false,
        'message' => __('Phone number is not valid', 'fluentformpro')
    ];
    return $element;
}