diff --git a/plugins/providers/docker/plugin.rb b/plugins/providers/docker/plugin.rb index 1420eed9f..05d3b8fab 100644 --- a/plugins/providers/docker/plugin.rb +++ b/plugins/providers/docker/plugin.rb @@ -1,6 +1,3 @@ -I18n.load_path << File.expand_path(File.dirname(__FILE__) + '/../../locales/en.yml') -I18n.reload! - module VagrantPlugins module DockerProvider class Plugin < Vagrant.plugin("2") @@ -8,11 +5,13 @@ module VagrantPlugins provider(:docker, parallel: true) do require_relative 'provider' + init! Provider end config(:docker, :provider) do require_relative 'config' + init! Config end @@ -20,6 +19,16 @@ module VagrantPlugins 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