• Resolved chiefscout2024

    (@chiefscout2024)


    hello can you add this function do support right design when change languages from ltr to rtl and vice versa?

    // Function to set the direction

    function updatePageDirection(language) {

        const rtlLanguages = ['ar', 'he', 'fa', 'ur']; // List of RTL language codes

        const htmlElement = document.documentElement;

        if (rtlLanguages.includes(language)) {

            htmlElement.setAttribute('dir', 'rtl'); // Set to RTL

            htmlElement.style.direction = 'rtl'; // Optional: Enforce CSS direction

        } else {

            htmlElement.setAttribute('dir', 'ltr'); // Set to LTR

            htmlElement.style.direction = 'ltr'; // Optional: Enforce CSS direction

        }

    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    RTL/LTR support is available in our paid version and depends on the theme’s ability to switch direction.

    Just switching the dir attribute and calling it a day does not always work and usually breaks a lot of things like sliders. We have no plans adding that in our free version.

    Thanks! 🙂

    Thread Starter chiefscout2024

    (@chiefscout2024)

    thank you 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Page direction support for ltr/rtl languages’ is closed to new replies.