Change Translatable impl to keep track of enabled locales

This commit is contained in:
Marko Lovic
2018-08-06 16:21:53 +02:00
committed by Javi Martín
parent cb716e07d7
commit 4603a30f95
4 changed files with 28 additions and 12 deletions

View File

@@ -27,7 +27,11 @@ module GlobalizeHelper
end
def css_to_display_translation?(resource, locale)
resource.translated_locales.include?(neutral_locale(locale)) || locale == I18n.locale ? "" : "display: none"
enable_locale?(resource, locale) ? "" : "display: none"
end
def enable_locale?(resource, locale)
resource.translated_locales.include?(neutral_locale(locale)) || locale == I18n.locale
end
def highlight_current?(locale)