Remove obsolete parameter rendering globalize locales
This parameter isn't used since commitb86c0d3c3, which deleted a file that wasn't used since commit146c09adb. Further proof that this code wasn't used is the fact that the `enable_translation_style` method, which this code called, was removed in commit5ada97544.
This commit is contained in:
@@ -4,6 +4,6 @@
|
||||
text,
|
||||
rows: 5,
|
||||
class: "js-globalize-attribute",
|
||||
style: site_customization_display_translation_style(locale),
|
||||
style: site_customization_display_translation_style,
|
||||
data: { locale: locale } %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Admin::SiteCustomization::InformationTexts::FormFieldComponent < ApplicationComponent
|
||||
attr_reader :i18n_content, :locale
|
||||
use_helpers :globalize, :site_customization_display_translation_style
|
||||
use_helpers :globalize, :site_customization_enable_translation?
|
||||
|
||||
def initialize(i18n_content, locale:)
|
||||
@i18n_content = i18n_content
|
||||
@@ -22,4 +22,8 @@ class Admin::SiteCustomization::InformationTexts::FormFieldComponent < Applicati
|
||||
def i18n_text
|
||||
I18n.translate(i18n_content.key, locale: locale)
|
||||
end
|
||||
|
||||
def site_customization_display_translation_style
|
||||
site_customization_enable_translation?(locale) ? "" : "display: none;"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,10 +3,6 @@ module SiteCustomizationHelper
|
||||
I18nContentTranslation.existing_languages.include?(locale) || locale == I18n.locale
|
||||
end
|
||||
|
||||
def site_customization_display_translation_style(locale)
|
||||
site_customization_enable_translation?(locale) ? "" : "display: none;"
|
||||
end
|
||||
|
||||
def information_texts_tabs
|
||||
[:basic, :debates, :community, :proposals, :polls, :legislation, :budgets, :layouts, :mailers,
|
||||
:management, :welcome, :machine_learning]
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<%= render "shared/globalize_locales",
|
||||
resource: @process,
|
||||
display_style: lambda { |locale| enable_translation_style(@process, locale) },
|
||||
manage_languages: false %>
|
||||
<%= render "shared/globalize_locales", resource: @process, manage_languages: false %>
|
||||
|
||||
<%= translatable_form_for [:admin, @process], url: url do |f| %>
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<%= render "shared/globalize_locales",
|
||||
resource: @process,
|
||||
display_style: lambda { |locale| enable_translation_style(@process, locale) },
|
||||
manage_languages: false %>
|
||||
<%= render "shared/globalize_locales", resource: @process, manage_languages: false %>
|
||||
|
||||
<%= translatable_form_for [:admin, @process] do |f| %>
|
||||
<div class="row">
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
<%= render "shared/common_globalize_locales",
|
||||
resource: nil,
|
||||
display_style: lambda { |locale| site_customization_display_translation_style(locale) },
|
||||
manage_languages: true %>
|
||||
<%= render "shared/common_globalize_locales", resource: nil, manage_languages: true %>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<% if translations_interface_enabled? %>
|
||||
<%= render "shared/common_globalize_locales",
|
||||
resource: resource,
|
||||
display_style: lambda { |locale| enable_translation_style(resource, locale) },
|
||||
manage_languages: defined?(manage_languages) ? manage_languages : true %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user