From 07577a050c1a2faefd9fa323b310e71a3f161907 Mon Sep 17 00:00:00 2001 From: taitus Date: Sat, 1 Jun 2019 22:53:31 +0200 Subject: [PATCH] Cover special translation interface behavior at admin information texts When not yet exists I18nContentTranslation languages, SiteCustomization::InformationText section render I18n.locale by default. This was causing that `languages in use` description and default selected language were incorrectly initialized. --- app/helpers/globalize_helper.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/helpers/globalize_helper.rb b/app/helpers/globalize_helper.rb index 96f1d3fbd..592b49170 100644 --- a/app/helpers/globalize_helper.rb +++ b/app/helpers/globalize_helper.rb @@ -60,6 +60,11 @@ module GlobalizeHelper end end + def languages_count + count = I18nContentTranslation.existing_languages.count + count > 0 ? count : 1 + end + def display_translation_style(resource, locale) "display: none;" unless display_translation?(resource, locale) end