Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1485109

    Hi,
    How can I fix the shown area on picture. I want to see that text in English but it automatically uses Turkish.
    https://drive.google.com/file/d/13pA4OiR4apL6lFmwKH3RXoa_675Klofp/view?usp=sharing

    #1485138

    Hey inovatifglobaltr,

    Thank you for the inquiry.

    You can use this filter in the functions.php file to adjust the default label of the captcha.

    function avia_contact_form_elements_mod( $form_fields ) {
    	if ( isset( $form_fields['avia_age'] ) ) {
    		$form_fields['avia_age']['label'] = __( 'Verify you are human', 'avia_framework' );
    	}
    	return $form_fields;
    }
    
    add_filter( 'avia_contact_form_elements', 'avia_contact_form_elements_mod', 10, 1 );
    

    Let us know the result.

    Best regards,
    Ismael

    #1485279

    Thanks Ismail,
    Yes it is fixed. But this time, message is shown in English on the Turkish contact form page :)
    Is it possible to edit this for each different contact form?

    #1485310

    Hi,

    Thank you for the update.

    Are you using a translation plugin? You can try to use the following code instead to apply different labels for each language.

    function avia_contact_form_elements_mod( $form_fields ) {
    	if ( isset( $form_fields['avia_age'] ) ) {
    		$lang = get_locale();
    
    		if ( $lang === 'tr_TR' ) {
    			$form_fields['avia_age']['label'] = 'TRANSLATE THIS ONE TO tr_TR';
    		} else {
    			$form_fields['avia_age']['label'] = 'Verify you are human';
    		}
    	}
    	return $form_fields;
    }
    add_filter( 'avia_contact_form_elements', 'avia_contact_form_elements_mod', 10, 1 );

    If you’re using a translation plugin such as WPML or Polylang, you can use the following plugin to manually add translations for the new label.

    https://wordpress.org/plugins/loco-translate/
    https://wordpress.org/plugins/say-what/

    Best regards,
    Ismael

    #1485329

    Hi,
    I don’t use a translation plugin. There are only two different pages. I added the links.

    #1485359

    Hi,

    Thank you for the info. Try to replace the filter with this:

    function avia_contact_form_elements_mod( $form_fields ) {
    	if ( isset( $form_fields['avia_age'] ) ) {
    		if ( is_page(266) ) {
    			$form_fields['avia_age']['label'] = 'TRANSLATE THIS ONE TO tr_TR';
    		} elseif ( is_page(68) ) {
    			$form_fields['avia_age']['label'] = 'Verify you are human';
    		}
    	}
    	return $form_fields;
    }
    add_filter( 'avia_contact_form_elements', 'avia_contact_form_elements_mod', 10, 1 );

    Make sure to adjust the tr_TR label.

    Best regards,
    Ismael

    #1485376

    Thanks Ismail,
    I got what I wanted but “tr_TR” is added to the end of the sentence :)

    https://drive.google.com/file/d/18HU7V8yl91bB9aTvM8cDhDB9CFmNuQ6V/view?usp=sharing

    #1485397

    Hi!

    Did you remove the ” tr_TR” part from the label?

    $form_fields['avia_age']['label'] = 'TRANSLATE THIS ONE TO tr_TR';
    

    Best regards,
    Ismael

    #1485429

    Hi,

    My mistake :))
    Thank you for your help.

    #1485447

    Hi,

    Thanks for the update. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

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