From 864fcf76066f578f4c5e6ea9558ba16f91535ecf Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Wed, 10 May 2023 14:51:01 +0000 Subject: [PATCH] Fixes #36379 - Use plugin dsl for gettext --- lib/foreman_ansible/engine.rb | 8 -------- lib/foreman_ansible/register.rb | 3 ++- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/foreman_ansible/engine.rb b/lib/foreman_ansible/engine.rb index 4415ea701..fad1a4c8e 100644 --- a/lib/foreman_ansible/engine.rb +++ b/lib/foreman_ansible/engine.rb @@ -19,14 +19,6 @@ class Engine < ::Rails::Engine config.autoload_paths += Dir["#{config.root}/app/views"] config.autoload_paths += Dir["#{config.root}/app/lib"] - initializer 'foreman_ansible.register_gettext', - :after => :load_config_initializers do - locale_dir = File.join(File.expand_path('../..', __dir__), 'locale') - locale_domain = 'foreman_ansible' - - Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir - end - initializer 'foreman_ansible.register_plugin', :before => :finisher_hook do require 'foreman_ansible/register' end diff --git a/lib/foreman_ansible/register.rb b/lib/foreman_ansible/register.rb index 40d80d8db..6ef4418a1 100644 --- a/lib/foreman_ansible/register.rb +++ b/lib/foreman_ansible/register.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true Foreman::Plugin.register :foreman_ansible do - requires_foreman '>= 3.6' + requires_foreman '>= 3.7' + register_gettext settings do category :ansible, N_('Ansible') do