Module: PagesCore::Admin::LocalesHelper
- Included in:
- AdminHelper, LocalizedFormBuilder
- Defined in:
- app/helpers/pages_core/admin/locales_helper.rb
Instance Method Summary collapse
- #locale_direction(locale) ⇒ Object
- #locales_with_dir ⇒ Object
- #rtl_locale?(locale) ⇒ Boolean
- #rtl_locales ⇒ Object
Instance Method Details
#locale_direction(locale) ⇒ Object
13 14 15 |
# File 'app/helpers/pages_core/admin/locales_helper.rb', line 13 def locale_direction(locale) rtl_locale?(locale) ? "rtl" : "ltr" end |
#locales_with_dir ⇒ Object
6 7 8 9 10 11 |
# File 'app/helpers/pages_core/admin/locales_helper.rb', line 6 def locales_with_dir locales = PagesCore.config.locales || {} locales.each_with_object({}) do |(key, name), hash| hash[key] = { name: name, dir: locale_direction(key) } end end |
#rtl_locale?(locale) ⇒ Boolean
17 18 19 |
# File 'app/helpers/pages_core/admin/locales_helper.rb', line 17 def rtl_locale?(locale) rtl_locales.include?(locale.to_s) end |
#rtl_locales ⇒ Object
21 22 23 |
# File 'app/helpers/pages_core/admin/locales_helper.rb', line 21 def rtl_locales %w[ar arc dv fa ha he khw ks ku ps ur yi] end |