Skip to content

Commit

Permalink
providers/docker: Lazy load locales
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrehm authored and mitchellh committed Apr 21, 2014
1 parent 8c8826f commit 3325bce
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions plugins/providers/docker/plugin.rb
@@ -1,25 +1,34 @@
I18n.load_path << File.expand_path(File.dirname(__FILE__) + '/../../locales/en.yml')
I18n.reload!

module VagrantPlugins
module DockerProvider
class Plugin < Vagrant.plugin("2")
name "docker-provider"

provider(:docker, parallel: true) do
require_relative 'provider'
init!
Provider
end

config(:docker, :provider) do
require_relative 'config'
init!
Config
end

synced_folder(:docker) do
require File.expand_path("../synced_folder", __FILE__)
SyncedFolder
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

0 comments on commit 3325bce

Please sign in to comment.