It turns out it is not necessary to downcase and underscore locale names to use the globalize-accessor gem. The gem will automatically underscore the locale name when defining and calling the accessor methods.
10 lines
318 B
Ruby
10 lines
318 B
Ruby
module SiteCustomizationHelper
|
|
def site_customization_enable_translation?(locale)
|
|
I18nContentTranslation.existing_languages.include?(locale) || locale == I18n.locale
|
|
end
|
|
|
|
def site_customization_display_translation?(locale)
|
|
site_customization_enable_translation?(locale) ? "" : "display: none;"
|
|
end
|
|
end
|