Condense state description retrieval

Reduce state description retrieval to keying off the state id and use a
simple substitution for the short name of the same.
This commit is contained in:
Darragh Bailey 2015-07-28 14:55:06 +01:00
parent cee934a482
commit e7dec9acc3
2 changed files with 8 additions and 17 deletions

View File

@ -109,8 +109,8 @@ module VagrantPlugins
state_id = :preparing if @machine.id == "preparing"
# Get the short and long description
short = I18n.t("vagrant_libvirt.states.short_#{state_id}")
long = I18n.t("vagrant_libvirt.states.long_#{state_id}")
short = state_id.to_s.gsub("_", " ")
long = I18n.t("vagrant_libvirt.states.#{state_id}")
# If we're not created, then specify the special ID flag
if state_id == :not_created

View File

@ -139,24 +139,15 @@ en:
TCP tunnel port not defined.
states:
short_paused: |-
pause
short_shutoff: |-
shutoff
long_shutoff: |-
paused: |-
The Libvirt domain is suspended. Run `vagrant resume` to resume it.
shutoff: |-
The Libvirt domain is not running. Run `vagrant up` to start it.
short_not_created: |-
not created
long_not_created: |-
not_created: |-
The Libvirt domain is not created. Run `vagrant up` to create it.
short_running: |-
running
long_running: |-
running: |-
The Libvirt domain is running. To stop this machine, you can run
`vagrant halt`. To destroy the machine, you can run `vagrant destroy`.
short_preparing: |-
preparing
long_preparing: |-
preparing: |-
The vagrant machine is being prepared for creation, please wait for
it to reach a steady state before issuing commands on it.