# frozen_string_literal: true class ApplicationViewComponent < ViewComponentContrib::Base extend Dry::Initializer # It seems like there is an issue with the translation as we use them # Because view_component_contrib defines a scope as array and then view_component expects a string # the result is messed up. Here I override contrib's behaviour to keep a string def self.i18n_scope return @i18n_scope if defined?(@i18n_scope) @i18n_scope = self.class.name.sub('::Component', '').underscore.tr('/', '.') end end