diff --git a/admin/app/components/solidus_admin/base_component.rb b/admin/app/components/solidus_admin/base_component.rb index 1da4c637c45..fd1f74a8020 100644 --- a/admin/app/components/solidus_admin/base_component.rb +++ b/admin/app/components/solidus_admin/base_component.rb @@ -13,31 +13,6 @@ def icon_tag(name, **attrs) render component("ui/icon").new(name: name, **attrs) end - module InheritableTranslations - def build_i18n_backend - return if compiled? - - # We need to load the translations files from the ancestors so a component - # can inherit translations from its parent and is able to overwrite them. - translation_files = ancestors.reverse_each.with_object([]) do |ancestor, files| - if ancestor.is_a?(Class) && ancestor < ViewComponent::Base - files.concat(ancestor.sidecar_files(%w[yml yaml].freeze)) - end - end - - # In development it will become nil if the translations file is removed - self.i18n_backend = if translation_files.any? - ViewComponent::Translatable::I18nBackend.new( - i18n_scope: i18n_scope, - load_paths: translation_files - ) - end - end - end - - # Can be removed once https://github.com/ViewComponent/view_component/pull/1934 is released - extend InheritableTranslations unless Gem::Version.new(ViewComponent::VERSION::STRING) >= Gem::Version.new("3.9") - def missing_translation(key, options) keys = I18n.normalize_keys(options[:locale] || I18n.locale, key, options[:scope]) diff --git a/admin/solidus_admin.gemspec b/admin/solidus_admin.gemspec index 72face62ce9..ff956c3b16e 100644 --- a/admin/solidus_admin.gemspec +++ b/admin/solidus_admin.gemspec @@ -30,5 +30,5 @@ Gem::Specification.new do |s| s.add_dependency 'solidus_core', '> 4.2' s.add_dependency 'stimulus-rails', '~> 1.2' s.add_dependency 'turbo-rails', '~> 1.4' - s.add_dependency 'view_component', '~> 3.3' + s.add_dependency 'view_component', '~> 3.9' end