17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'app/components/solidus_admin/base_component.rb', line 17
def build_i18n_backend
return if compiled?
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
self.i18n_backend = if translation_files.any?
ViewComponent::Translatable::I18nBackend.new(
i18n_scope: i18n_scope,
load_paths: translation_files
)
end
end
|