Remove obsolete parameter rendering globalize locales

This parameter isn't used since commit b86c0d3c3, which deleted a file
that wasn't used since commit 146c09adb. Further proof that this code
wasn't used is the fact that the `enable_translation_style` method,
which this code called, was removed in commit 5ada97544.
This commit is contained in:
Javi Martín
2024-04-03 22:42:44 +02:00
parent 161eaaff8b
commit 9a4a7bd56e
7 changed files with 9 additions and 19 deletions

View File

@@ -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 %>

View File

@@ -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

View File

@@ -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]

View File

@@ -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| %>

View File

@@ -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">

View File

@@ -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 %>

View File

@@ -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 %>