Home›Support›English Support›[Waiting for user feedback] Pages translated into Dari do not include the direction attribute, dir="rtl", however, our pages t...
[Waiting for user feedback] Pages translated into Dari do not include the direction attribute, dir="rtl", however, our pages t...
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.
Background of the issue:
I am trying to add the dir="rtl" attribute to pages on our site that have been translated into Dari. Currently, pages translated into Arabic have this attribute, but pages translated into Dari do not.
I have provided lines of code from our site for reference:
<html dir="rtl" lang="ar" id="html" class="" itemtype="hidden link" itemscope="" style="--scrollbar-offset: 15px;">
Thank you for contacting WPML support. While you wait for one of my colleagues to take this ticket and work on it, let me provide you with the first debugging steps or see if I can help with the issue quickly.
I assume you created a custom language for Dari. I say this because WPML does not include Dari as a built-in language. One approach to resolving this issue is to map it to Arabic. You can do it in WPML -> Languages -> Site Languages -> Edit languages (link). Please read more about this here.
WPML is fully compatible with RTL languages. While WPML allows you to translate into RTL or use RTL, the handling of RTL content is dependent on the theme's CSS as well as the language being registered as an RTL language.
Currently Dari is not officially supported by WordPress, therefore when adding it, there is nothing letting WordPress know that it's a RTL language.
Please review the following documentation along with the WP Codex on how you can configure the language to be RTL.