Skip to content

Commit

Permalink
Fixes #36379 - Use plugin dsl for gettext
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka authored and nofaralfasi committed May 15, 2023
1 parent 5cf2a3a commit 864fcf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 0 additions & 8 deletions lib/foreman_ansible/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion lib/foreman_ansible/register.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 864fcf7

Please sign in to comment.