Sha256: 5f37ced3f3ace68acd959e4a31ea39ef733d3dbac6e31a010539d65ba63b655e
Contents?: true
Size: 731 Bytes
Versions: 16
Compression:
Stored size: 731 Bytes
Contents
# frozen_string_literal: true module Decidim module Plans module LocaleAware extend ActiveSupport::Concern class_methods do def current_locale I18n.locale.to_s end end private # The current locale for the user. Available as a helper for the views. # # Returns a String. def current_locale @current_locale ||= self.class.current_locale end # The available locales in the application. Available as a helper for the # views. # # Returns an Array of Strings. def available_locales @available_locales ||= (current_organization || Decidim).public_send(:available_locales) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems