I am using qTranslate for bilingual Wordpress. One problem I have is with Contact Form 7 contact pages. I need the Arabic texts as options in the Contact 7 form, only when the user is seeing the site in Arabic.
Lets say I have the following:
[radio paymethod "VISA" "MASTERCARD" "AMEX"]
I need to show these values in Arabic when its Arabic mode. Also 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
```php
$lang = "&lang=" . qtrans_getLanguage();
return ((string) $wpcf7_request_uri) . $lang;
It changes my url to: http://example.com/contact-us/&lang=ar#wpcf7-f289-t1-o1
and that results in a 404.
qTranslate has three configs for language.
I have found the solution.
The contact forms can be created using a locale
at the beginning. I contacted the Plugin Author and he directed to this page
I also made changes to the settings.php
of the Contact form 7 as the following:
function wpcf7_get_request_uri() {
global $wpcf7_request_uri;
if (($GLOBALS['q_config']['hide_default_language'] == 1) AND ($GLOBALS['q_config']['default_language'] != $GLOBALS['q_config']['language']))
return ((string) '/' . $GLOBALS['q_config']['language'] . $wpcf7_request_uri);
}