This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to: get the Hebrew text to align right to left on a form created with Contact Form 7. Solution: This is caused by the Contact Form 7 plugin which saves the form in LTR instead of RTL when a Hebrew Contact form is created.

You can see this behavior even when WPML is disabled. This happens only with the Hebrew language. The Persian and Arabic contact forms are correctly assigned the RTL value by the CF7 plugin. This can be solved using a CSS code targeting the single form. You can see an example in this post: https://wpml.org/forums/topic/problem-getting-the-text-in-contact-form-7-to-align-right-to-left-hebrew/#post-1229006

0% of people find this useful.

This topic contains 8 replies, has 3 voices.

Last updated by Vincenzo 1 year, 4 months ago.

Assigned support staff: Vincenzo.

Author Posts
March 9, 2017 at 4:53 pm #1226648

sharonA-2

I am trying to: get the hebrew text to align right to left on a contact form 7

URL of (my) website where problem appears: hidden link

I expected to see: the text line up on the form starting on the right

Instead, I got: text align left see image: hidden link

Steps to duplicate the issue:

March 11, 2017 at 9:02 am #1227875

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello, thank you for contacting WPML Support!
I will take care of your ticket.

This is related to the Contact Form 7 plugin.
In order to achieve the RTL on a contact form, you need to create the Contact Form when you are in the Hebrew version of your backend.
Follow these steps:

- Use the language switcher on top of the backend to change the language to Hebrew.
- Go to Contact -> Add New
- Add a new Contact Form for the Hebrew version of the site.
- Use the resulting shortcode to add the contact form in the Hebrew Contact page.

Please let me know if this solves the issue or if you need further details.

Thank you

Related documentation:
- https://wpml.org/documentation/plugins-compatibility/using-contact-form-7-with-wpml/

March 12, 2017 at 6:47 am #1228099

sharonA-2

Hi Vincenzo. I tried that. went to the hebrew backend, and created a new form. embedded it into a hebrew page but unfortunately I am still getting the text aligned to the left and not to the right. hidden link.

Any other ideas?

March 13, 2017 at 11:37 am #1228675

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

I was able to reproduce the issue. It seems caused by the Contact Form 7 plugin which saves the form in ltr instead of rtl when a Hebrew Contact form is created.

You can see this behavior even when WPML is disabled.
This happens only with the Hebrew language. The Persian and Arabic contact forms are correctly assigned the rtl value by the CF7 plugin.

You can see the same issue reported here:
- https://wordpress.org/support/topic/languages-and-direction-langen-us-dirltr/

As a temporary workaround, you can add this CSS code in the Additional CSS box in WPML -> Languages:

form.wpcf7-form {
    direction: rtl;
}

Please let me know if this solves the issue or if you need further details.

Thank you

March 13, 2017 at 3:12 pm #1228991

sharonA-2

Hi Vincenzo,

That fix worked fine for the Hebrew. But I also have English forms and that messed up the English form.

Do you have an idea for a css fix that will only work on the Hebrew forms?

If I delete the cf7 and reinstall it, do you think it would help?

Thanks,
Sharon

March 13, 2017 at 3:29 pm #1229006

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

a specific code for Hebrew forms will not work here because these forms are registered as English.

You can solve this by using a more specific CSS code targeting the single form.
Try the following code instead of the previous one:

div#wpcf7-f872-p865-o1 {
    direction: rtl;
}

Reinstalling the CF7 plugin will not fix the issue. I think that the issue needs to be solved by the Contact Form 7 author.

Please let me know if this solves the issue or if you need further details.

Thank you

March 13, 2017 at 3:46 pm #1229031

sharonA-2

Thanks so much, that bit of code solved the problem.

best,
Sharon

May 26, 2018 at 8:11 pm #2234142

christinaR-3

Hi,
I have the same issue Sharon had and I tried to follow the solution (created the form in the Hebrew mode and placed the code [tried both]), but for me, the issue was not resolved.
Can you help me, please?
Thanks
Christina

May 28, 2018 at 7:53 am #2236694

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello Christina,

probably you just need to change the CSS code to match the div ID of your specific form.

Anyway, this ticket is closed.

May I ask you to open a new ticket?
You can do it from here: https://wpml.org/forums/forum/english-support/

Please add a link to this ticket too.
If you wish you can assign the new ticket to me.

Thank you