From 13c05de702fe393eda96743f1b0aa3900ca7ca6d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 30 Apr 2010 23:42:11 -0700 Subject: [PATCH] Rename errors.yml to strings.yml and Error to Translator, since I plan on using it for general strings --- lib/vagrant/actions/base.rb | 2 +- lib/vagrant/util.rb | 2 +- lib/vagrant/util/errors.rb | 36 --------------- lib/vagrant/util/translator.rb | 35 ++++++++++++++ templates/{errors.yml => strings.yml} | 0 .../{errors_test.rb => translator_test.rb} | 46 ++++++++++--------- 6 files changed, 62 insertions(+), 59 deletions(-) delete mode 100644 lib/vagrant/util/errors.rb create mode 100644 lib/vagrant/util/translator.rb rename templates/{errors.yml => strings.yml} (100%) rename test/vagrant/util/{errors_test.rb => translator_test.rb} (53%) diff --git a/lib/vagrant/actions/base.rb b/lib/vagrant/actions/base.rb index 4c920f24b..c8a381a9c 100644 --- a/lib/vagrant/actions/base.rb +++ b/lib/vagrant/actions/base.rb @@ -110,7 +110,7 @@ module Vagrant @key = key @data = data - message = Vagrant::Util::Errors.error_string(key, data) + message = Vagrant::Util::Translator.t(key, data) super(message) end end diff --git a/lib/vagrant/util.rb b/lib/vagrant/util.rb index ed917109d..d13879696 100644 --- a/lib/vagrant/util.rb +++ b/lib/vagrant/util.rb @@ -15,7 +15,7 @@ module Vagrant ===================================================================== Vagrant experienced an error! -#{Errors.error_string(key, data).chomp} +#{Translator.error_string(key, data).chomp} ===================================================================== error end diff --git a/lib/vagrant/util/errors.rb b/lib/vagrant/util/errors.rb deleted file mode 100644 index 124a69f04..000000000 --- a/lib/vagrant/util/errors.rb +++ /dev/null @@ -1,36 +0,0 @@ -require 'yaml' - -module Vagrant - module Util - # This class is responsible for outputting errors. It retrieves the errors, - # based on their key, from the error file, and then outputs it. - class Errors - @@errors = nil - - class <