WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] Bilingual implementation (8 posts)

  1. Lenin
    Member
    Posted 1 year ago #

    I need to get the error/success messages in the other languages(ie when the language is switched).

    I tried changing settings.php of the plugin. It was

    return (string) $wpcf7_request_uri;

    and now is

    $lang = "&lang=" . qtrans_getLanguage();
    return ((string) $wpcf7_request_uri) . $lang;

    Its changes my url to: http://example.com/contact-us/&lang=ar#wpcf7-f289-t1-o1 and that becomes 404.

    qTranslate has three configs for language. 1. query string 2. pre-Path Mode (puts /en/ in front) 3. en.yoursite.com. I am using 2.

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    You don't have to think it so difficult. Simply make two forms for two languages (see Contact Form in Your Language), and place en form in en post, ar form in ar post.

  3. Lenin
    Member
    Posted 1 year ago #

    Thanks!

    Now can I change the locale of an existing form I saved?

  4. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    Each form data doesn't have any locale information. So you don't have to change it.

  5. Lenin
    Member
    Posted 1 year ago #

    If that is so, please tell me how I can get different locale for an existing saved contact form.

  6. Lenin
    Member
    Posted 1 year ago #

    Also, offtopic to this thread but. I would request you to make a dynamic option to have the sequence of elements changed like below:

    if ( ! $this->responses_count )
    			$form .= $this->form_response_output();
    		$form .= $this->form_hidden_fields();
    
    		$form .= $this->form_elements();

    Because, twitterbootstrap by default puts the markup at the top of form.

  7. Lenin
    Member
    Posted 1 year ago #

    I am assuming that, when we select the locale before creating the contact form. It fetches the proper locale strings and the response strings with this post and maybe saves them also.

    The lines of codes I pasted above are from:
    contact-form-7/includes/classes.php

    Without making the change directly into the plugin code I wasn't able to get the form in TwitterBootstrap friendly manner.

  8. Lenin
    Member
    Posted 1 year ago #

    Also, submitting the form changes the site language so I had to modify your settings.php like below:

    return ((string) '/'.qtrans_getLanguage().$wpcf7_request_uri);

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic