Module: Spree::Admin::RtlHelper

Defined in:
app/helpers/spree/admin/rtl_helper.rb

Overview

View helpers for the legacy admin's layout direction (<html dir>). RTL detection itself lives on Spree::Locale (the single source of truth).

Instance Method Summary collapse

Instance Method Details

#html_dir(locale = I18n.locale) ⇒ Object



10
11
12
# File 'app/helpers/spree/admin/rtl_helper.rb', line 10

def html_dir(locale = I18n.locale)
  Spree::Locale.new(code: locale).direction
end

#rtl_locale?(locale = I18n.locale) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/helpers/spree/admin/rtl_helper.rb', line 6

def rtl_locale?(locale = I18n.locale)
  Spree::Locale.new(code: locale).rtl?
end