This wordpress plugin seems to be inserting the language direction and name into the <html> . eg:
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
OR
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="ar-AR">
If I understand that the plugin does not return the correct direction attribute for ltr languages.
First option
One option is to use javascript to fix this. we just discover rtl languages by their ISO-codes (here it is ar for Arabic) and adding a class to the body tag
jQuery(function(){ jQuery("html[lang=ar]").attr("dir", "rtl") .find("body").addClass("right-to-left"); });
Now you can style these elements in the theme css file, indicating that the right-to-left class looks like this: (this is just a sample)
body.right-to-left my-element li { float:right; direction: rtl; }
.
Second option
As suggested by another answer. Use php to insert this class name in the body tag of the page. open your header.php file in your theme and edit this line:
<body class=" <?php if($_GET["lang"] == "ar") echo "right-to-left"; ?> ">
Now use the same CSS for element styles
source share