Extract translation helper from translatable form views
So that individual form partials don't depend on the implementation of how translations are deleted.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
module SiteCustomizationHelper
|
||||
def site_customization_enable_translation?(locale)
|
||||
I18nContentTranslation.existing_languages.include?(neutral_locale(locale)) || locale == I18n.locale
|
||||
end
|
||||
|
||||
def site_customization_display_translation?(locale)
|
||||
I18nContentTranslation.existing_languages.include?(neutral_locale(locale)) || locale == I18n.locale ? "" : "display: none"
|
||||
site_customization_enable_translation?(locale) ? "" : "display: none"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user