Box actions now use I18n

This commit is contained in:
Mitchell Hashimoto 2010-08-27 20:47:21 -07:00
parent 1d29ba31fa
commit 367a51fae8
5 changed files with 18 additions and 7 deletions

View File

@ -10,7 +10,7 @@ module Vagrant
end
def call(env)
env.ui.info "Deleting box directory..."
env.ui.info "vagrant.actions.box.destroy.destroying", :name => env["box"].name
FileUtils.rm_rf(env["box"].directory)
@app.call(env)

View File

@ -30,7 +30,7 @@ module Vagrant
def instantiate_downloader
@env["download.classes"].each do |klass|
if klass.match?(@env["box"].uri)
@env.ui.info "Downloading with #{klass}..."
@env.ui.info "vagrant.actions.box.download.with", :class => klass.to_s
@downloader = klass.new(@env)
end
end
@ -53,13 +53,12 @@ module Vagrant
def recover(env)
if temp_path && File.exist?(temp_path)
env.ui.info "Cleaning up downloaded box..."
env.ui.info "vagrant.actions.box.download.cleaning"
File.unlink(temp_path)
end
end
def with_tempfile
@env.ui.info "Creating tempfile for storing box file..."
File.open(box_temp_path, Platform.tar_file_options) do |tempfile|
yield tempfile
end
@ -70,7 +69,7 @@ module Vagrant
end
def download_to(f)
@env.ui.info "Copying box to temporary location..."
@env.ui.info "vagrant.actions.box.download.copying"
@downloader.download!(@env["box"].uri, f)
end
end

View File

@ -49,7 +49,7 @@ module Vagrant
def decompress
Dir.chdir(@env["box"].directory) do
@env.ui.info "Extracting box to #{@env["box"].directory}..."
@env.ui.info "vagrant.actions.box.unpackage.extracting"
Archive::Tar::Minitar.unpack(@env["download.temp_path"], @env["box"].directory)
end
end

View File

@ -9,7 +9,7 @@ module Vagrant
def call(env)
begin
env.ui.info "Verifying box..."
env.ui.info "vagrant.actions.box.verify.verifying"
VirtualBox::Appliance.new(env["box"].ovf_file)
rescue Exception
return env.error!(:box_verification_failed)

View File

@ -163,3 +163,15 @@ en:
setup_unison: Creating unison crontab entries...
suspend:
suspending: Saving VM state and suspending execution...
box:
destroy:
destroying: Deleting box '%{name}'...
download:
with: Downloading with %{class}...
cleaning: Cleaning up downloaded box...
copying: Copying box to temporary location...
unpackage:
extracting: Extracting box...
verify:
verifying: Verifying box...