Skip Navigation

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

Problem:
The client wanted one page to display in a right-to-left (RTL) format and another page to display in a left-to-right (LTR) format.

Solution:
We explained that text direction is controlled by CSS, and it is the theme's CSS files that determine whether a page is displayed RTL or LTR. We reviewed the client's site and confirmed that the pages were displaying in the correct directions. We also asked the client to verify the source code of the RTL page, which correctly included

dir="rtl" lang="he-IL"

, indicating that the RTL direction was set up correctly.

If you're experiencing similar issues with text direction on your multilingual site, we recommend checking your theme's CSS files for the correct text direction settings. Additionally, you can verify the source code of your pages to ensure that the

dir

attribute is set correctly for RTL or LTR languages.

Please note that the solution provided might be irrelevant due to being outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.

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.

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by louisN-4 3 years, 1 month ago.

Assisted by: Osama Mersal.

Author Posts
March 7, 2021 at 3:04 pm #8245593

louisN-4

i want this page to show right to left:
hidden link

and this page for example from left to right:
hidden link

i read this
https://wpml.org/wpml-hook/wpml_is_rtl/

but not sure if its exactly the code snippet i need to put

March 7, 2021 at 3:10 pm #8245695

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I’ll be glad to help you today.

1) The RTL direction is defined by CSS. WPML doesn't create the CSS, so your theme has to be RTL supporting. Kindly check this guide to know more about how to build RTL WordPress themes. (https://wpml.org/documentation/theme-compatibility/build-rtl-wordpress-themes/)

2) Could you please share your Debug information with me?
You can read a detailed explanation about it here.
http://wpml.org/faq/provide-debug-information-faster-support
The debug info will give me a lot of information about how your site is configured and will help me understand the source of the problem.

Thanks for your cooperation

Regards,
Osama

March 7, 2021 at 5:13 pm #8245921

louisN-4

i am not 100% you are sure its css, because if you go to product pages

hidden link

and move between hebrew and english you will see the alignment is correct.

March 7, 2021 at 5:30 pm #8245937

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

TRL and LTR directions come from CSS, so the theme's CSS files are responsible for the direction. (Kindly check the attached screenshot 3)

I've checked your site and the pages seem that they have the right directions (Kindly check the attached screenshot 1,2)

Could you please help me understand the issue more because it seems that the RTL is working correctly? (Kindly check this link "view-source:hidden link" its the source code of the page on your ticket, and it says "dir="rtl" lang="he-IL")

Thanks for your cooperation

Best regards,
Osama

1.png
2.png
3.png
March 7, 2021 at 8:38 pm #8246293

louisN-4

I dont know what to tell you,

since i translated everything with WPML automatic

so i am asking you for assistance

March 7, 2021 at 8:56 pm #8246339

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

1) I've visited this page hidden link
and its translation hidden link

The layout of the page is RTL, But the content direction is wrong. It's a CSS issue. (Kindly check the attached screenshot)

2) I would need to take a closer look at your site. So I would need to request temporary access (WP-Admin and FTP)
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed

Your next answer will be private, which means only you and I have access to it.

❌ Please backup your database and website ❌

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme and to change configurations on the site if needed. This is also a reason the backup is critical.

Thanks for your cooperation

Regards,
Osama

1.jpg
March 7, 2021 at 10:07 pm #8246547

louisN-4

no need to enter the site,
i entered the specific pages, and changed the source of the them to text-align: right
and it solved the problem

you helped me a lot, thank you

*** but i would still report to your team, that if they see text-align: left and the translated language to is hebrew/arabic or any other RTL, they should change this to text-align: right

March 8, 2021 at 7:46 am #8248307

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

It's great to hear it's resolved. WPML helps with the functionality part, but the issue, in this case, is actually the styling we do not control. The RTL support needs to be added by the theme or by the user that added the custom CSS.

Because sometimes, it's an RTL language, but in some particular part of the RTL page, the user wants the text to "align: left" like an icon box or an alert box, or any other design element.

I hope I explained my answer correctly. If you need any further info, please let me know.

Thanks,
Osama

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.