PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Multilingual site with qtranslate error handling fails

  1. hegeman
    Member

    I have a multilingual site using the qTranslate plugin (qTranslate 2.8.15 wp 3.1 and gravity forms 1.5). For each form I make a version for each language and drop it in the correct language tab in the content area. That works fine except for one thing, the error handling.

    In the default language the error messages work correct e.g. if someone forgets to fill in an obliged field. But in non-default languages no error message shows up and worse, the user gets an empty form in the default language upon sending in stead of the error.

    I guess it's the ajax that is not picking up the language. Is there a way to make this work for multiple languagues?
    Or is there perhaps another language plugin I could/should use that works better with Gravity Forms?
    Any help is much appreciated.... thanks

    Posted 13 years ago on Wednesday April 6, 2011 | Permalink
  2. I'm not familiar with the qTranslate plugin, I do know that it should be compatible with the WPML plugin and it works in similar fashion, you'd insert the appropriate form into the appropriate language content. The error messages may still be an issue.

    http://www.wpml.org

    The good news is we are working with the WPML team to make a Gravity Forms Add-On for WPML that will allow you to create 1 form that supports multiple languages by translating the strings associated with the form. So then instead of creating multiple forms, you only create and manage 1 form... but you use an admin tool to add your translations. It will be more seamless. This is currently in development, the WPML guys are working on it with our input.

    Posted 13 years ago on Wednesday April 6, 2011 | Permalink
  3. kevinfilteau
    Member

    I found that from there :
    http://ckon.wordpress.com/2006/08/09/server-request_uri-doesnt-always-work-correctly-heres-how-to-fix/
    If you replace this line

    $pageURL .= RGForms::get("HTTP_HOST", $_SERVER). RGForms::get("REQUEST_URI", $_SERVER);

    with this line

    $pageURL .= RGForms::get("HTTP_HOST", $_SERVER) . $GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI'];

    in the public function get_current_page_url() of the forms_model.php file everything works fine.

    Posted 13 years ago on Thursday May 5, 2011 | Permalink
  4. Thanks for the suggestion, but I am having a little trouble with the solution. $GLOBALS['HTTP_SERVER_VARS'] is not defined in my local environment.
    I am going to confess that I have had a hard time with getting the current page URL in PHP/WordPress, but I am not sure the $GLOBALS['HTTP_SERVER_VARS'] is a foolproof way of doing it either.

    Posted 13 years ago on Thursday May 5, 2011 | Permalink
  5. gfdd
    Member

    I'm having the same, or a similar, problem. Forms on pages that are not in the default language redirect the user to a blank form upon submission as opposed to redirecting them to the "success" message. I tried to apply the hack suggested by kevinfilteau but it still doesn't work

    Please, it is urgent to have this fixed!

    Posted 13 years ago on Monday May 16, 2011 | Permalink
  6. There is nothing to fix in Gravity Forms. Any issues related to form submission with qTranslate are going to be due to how qTranslate handles language pages. There isn't anything to change in Gravity Forms so there is nothing to fix in Gravity Forms. qTranslate would have to investigate the issue on their end.

    Gravity Forms is known to work with WPML (http://www.wpml.org) and in fact the guys at WPML have created their own Gravity Forms Add-On that lets you translate forms just like you translate pages using WPML. So there is tighter integration with WPML because the WPML guys actually work with Gravity Forms and make sure their product works with ours.

    Posted 13 years ago on Monday May 16, 2011 | Permalink
  7. gfdd
    Member

    Sorry if I sounded rude, I know this is probably not Gravity's fault, but when I bought the license for Gravity Forms last year, you did not report any incompatibilities with Qtranslate nor did the WPML integration exist back then.

    Now the site we bought Gravity for is finished and developed with Qtranslate and we cannot start from scratch. Still, the forms are not working, which is why I'm asking for some help in debugging/working around the issue right here.

    Posted 13 years ago on Monday May 16, 2011 | Permalink
  8. Gravity Forms was working with qtranslate, however that was a year ago and qtranslate may have been updated since then. I would suggest getting in touch with the qtranslate developer as they are going to know their product better than we do in order to debug what is going on.

    Posted 13 years ago on Monday May 16, 2011 | Permalink
  9. I also use qTranslate for WP sites I make. I will look into the issues if they will arise.
    Generally, qTranslate uses fairly simple hooks, so I do not really expect any problems.
    Will tell you how it goes.

    Posted 13 years ago on Tuesday May 17, 2011 | Permalink
  10. Any update on this? I get a blank page when a form gets submitted in a non default language to... any help is highly appreciated!

    regards marcel

    Posted 13 years ago on Thursday July 7, 2011 | Permalink
  11. This is an issue on the qTranslate end and how they integrate with WordPress. You would need to notify the qTranslate developers, it would benefit them to fix whatever the problem is because currently we recommend users use the WPML plugin (http://wpml.org) for translations specifically because it works with Gravity Forms and they provide an Add-On for translating your forms as well as your pages so you can use one form in multiple languages.

    Posted 13 years ago on Thursday July 7, 2011 | Permalink
  12. I'm looking for a solution to this as well. My PHP skills are decidedly lacking, but in looking at kevinfilteau's suggestion above, I wonder if some logic could be added to this function to detect the current language and adjust the URL accordingly:

    public function get_current_page_url() {
            $pageURL = 'http';
            if (RGForms::get("HTTPS",$_SERVER) == "on")
                $pageURL .= "s";
            $pageURL .= "://";
    
            $pageURL .= RGForms::get("HTTP_HOST", $_SERVER) . rgget("REQUEST_URI", $_SERVER);
            return $pageURL;
        }

    Has anyone else made any progress on a work-around? I'm desperate to resolve this issue.

    Posted 13 years ago on Friday September 23, 2011 | Permalink
  13. I am not aware of any solution. But I know WPML (http://www.wpml.org) doesn't have this issue so the issue is going to be how qTranslate handles page translations and manipulates/changes WordPress.

    Posted 13 years ago on Friday September 23, 2011 | Permalink
  14. Thanks... the site I'm working on was done before WPML was an option, and at this point switching to it isn't a practical solution. qTranslate appends the URL with a language code to handle the language selection. For example, to display the content in Spanish, the URL http://www.mysite.com/mypage is changed to http://www.mysite.com/es/mypage. Is the code snippet above the correct place to add some logic to check the current language and change the URL if needed?

    Posted 13 years ago on Friday September 23, 2011 | Permalink
  15. That is going to be the problem. The URL isn't the same. qTranslate is changing how URL Rewriting functions which causes problems with the form submission process and the form action which uses the current URL.

    The function above was one a user had posted, we aren't familiar with it and can't reproduce this issue locally because our server environment is different. So it's not something we've been able to recreate in order to test. But I can have our lead developer take another look.

    Posted 13 years ago on Friday September 23, 2011 | Permalink
  16. Hi Carl

    Did you manage to have a look into this with your developer? Any change we will get the forms to work with Qtranslate. I know about WPML, but just as Gfdd, the Sites are already running with the Plugin and I would like them to use this Forms in Translation to!

    Thanks and regards

    Posted 13 years ago on Thursday October 27, 2011 | Permalink