Sha256: 57d8c6045e325252275832d1f139b5b281001d73e0bdee6be16aaad7627a7c0a
Contents?: true
Size: 585 Bytes
Versions: 12
Compression:
Stored size: 585 Bytes
Contents
# frozen_string_literal: true module PagesCore module Admin module LocalesHelper 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 def locale_direction(locale) rtl_locale?(locale) ? "rtl" : "ltr" end def rtl_locale?(locale) rtl_locales.include?(locale.to_s) end def rtl_locales %w[ar arc dv fa ha he khw ks ku ps ur yi] end end end end
Version data entries
12 entries across 12 versions & 1 rubygems