providers/docker: Lazy load locales

This commit is contained in:
Fabio Rehm 2014-03-26 21:01:34 -03:00 committed by Mitchell Hashimoto
parent 8c8826fe09
commit 3325bce2d0
1 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,3 @@
I18n.load_path << File.expand_path(File.dirname(__FILE__) + '/../../locales/en.yml')
I18n.reload!
module VagrantPlugins module VagrantPlugins
module DockerProvider module DockerProvider
class Plugin < Vagrant.plugin("2") class Plugin < Vagrant.plugin("2")
@ -8,11 +5,13 @@ module VagrantPlugins
provider(:docker, parallel: true) do provider(:docker, parallel: true) do
require_relative 'provider' require_relative 'provider'
init!
Provider Provider
end end
config(:docker, :provider) do config(:docker, :provider) do
require_relative 'config' require_relative 'config'
init!
Config Config
end end
@ -20,6 +19,16 @@ module VagrantPlugins
require File.expand_path("../synced_folder", __FILE__) require File.expand_path("../synced_folder", __FILE__)
SyncedFolder SyncedFolder
end end
protected
def self.init!
return if defined?(@_init)
I18n.load_path << File.expand_path(
"templates/locales/providers_docker.yml", Vagrant.source_root)
I18n.reload!
@_init = true
end
end end
end end
end end