From 1c2208a30ee3c54cd058e9e9dfdb56a442737d15 Mon Sep 17 00:00:00 2001 From: Sergey Leschenko Date: Tue, 18 Oct 2016 14:40:37 +0300 Subject: [PATCH] Load locale file only once --- lib/vagrant-lxc/plugin.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-lxc/plugin.rb b/lib/vagrant-lxc/plugin.rb index bf8f4dd..b8ac0cf 100644 --- a/lib/vagrant-lxc/plugin.rb +++ b/lib/vagrant-lxc/plugin.rb @@ -8,12 +8,16 @@ module Vagrant The LXC provider allows Vagrant to manage and control LXC-based virtual machines. EOF + locale_loaded = false 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! + if not locale_loaded + I18n.load_path << File.expand_path(File.dirname(__FILE__) + '/../../locales/en.yml') + I18n.reload! + locale_loaded = true + end Provider end