Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #884200

    Hi all,

    I am working on a multi-language site, and I’d like to have different languages set for the Contact Forms in different parts of the site.

    I created a new plugin using this code to change all form CAPCHAs to Croatian language:

    add_filter('avia_contact_form_elements', 'avia_change_caption_captcha', 10, 1);
    function avia_change_caption_captcha($form_fields)
    {
            if(!empty($form_fields['avia_age']['label'])) $form_fields['avia_age']['label'] = "Potvrdite da niste robot unošenjem točnog iznosa.";
        return $form_fields;
    }

    But I need them in Croatian in some parts of the site, and English in the others. I’d also like to expand to other languages later on. For example:
    http://mysite.com/en/
    http://mysite.com/hr/

    Thanks in advance.

    #885143

    Hey si_lyons,

    You need to wrap the text in the translationfunction, like this:

    __("Potvrdite da niste robot unošenjem točnog iznosa.",'your_text_domain')

    If you need further assistance please let us know.
    Best regards,
    Victoria

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