Merge pull request #423 from sergle/master

Load locale file only once
This commit is contained in:
Cam Cope 2016-10-21 00:54:57 -07:00 committed by GitHub
commit a68a1de21f

View file

@ -11,20 +11,19 @@ module Vagrant
provider(:lxc, parallel: true, priority: 7) do
require File.expand_path("../provider", __FILE__)
I18n.load_path << File.expand_path(File.dirname(__FILE__) + '/../../locales/en.yml')
I18n.reload!
init!
Provider
end
command "lxc" do
require_relative 'command/root'
init!
Command::Root
end
config(:lxc, :provider) do
require File.expand_path("../config", __FILE__)
init!
Config
end
@ -37,6 +36,16 @@ module Vagrant
require_relative "provider/cap/public_address"
Provider::Cap::PublicAddress
end
protected
def self.init!
return if defined?(@_init)
I18n.load_path << File.expand_path(File.dirname(__FILE__) + '/../../locales/en.yml')
I18n.reload!
@_init = true
end
end
end
end