Home Forums Pro Themes Bizlight Pro How to translate the SUBMIT button on form?

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1254
    Simon
    Participant

    Hi,

    I have purchased the theme and evrything is going well excecpt for the Language. My site is in french and when I add a FORM, the button is in english (Submit)

    Here is the adress:
    L’Hypothèque Simplifiée – Obtenir le livre

    I need to change Submit to Soumettre
    And Required by Requis

    Thanks for your help

    #1264
    wensolutions
    Keymaster

    Hello @simon,
    It looks like you have used some contact form plugin for the form. So, while creating a form from that plugin you can select language for the form like this contact form plugin does (https://wordpress.org/plugins/contact-form-7/) and all the form text will be in that selected language. Alternatively, you can use a WordPress function which translates texts (https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext). For example:
    To change ‘Name’ to ‘First name’, just add the below codes in ‘functions.php’ of child theme.

    add_filter( 'gettext', 'theme_change_comment_field_names', 20, 3 );
    function theme_change_comment_field_names( $translated_text, $text, $domain ) {
    
        if ( is_singular() ) {
    
            switch ( $translated_text ) {
    
                case 'Name' :
    
                    $translated_text = __( 'First Name', 'Bizlight' ); 
                    break;
            }
    
        }
    
        return $translated_text;
    }

    Note: This function translates all the matching text to the translating text allover the theme.
    Also, create child theme if you are going for the coding option. For that: https://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme

    Best regards,

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.