Type
magento2-module
Magento2 RTL detection
magento2-module
MIT
None
None
None
None
None
None
Detect RTL locale and add CSS class name to the body element if matched.
cd <magento_root>
composer require swissup/rtl
bin/magento module:enable Swissup_Rtl
bin/magento setup:upgrade
Inject \Swissup\Rtl\Helper\Data
into your class call isRtl
method:
// Check current locale
$helper->isRtl();
// Check custom locale
$helper->isRtl('en_US');