Move validation message to locales

This commit is contained in:
Brian Cain 2019-11-22 13:50:29 -08:00
parent 3e177d380f
commit 86f9243762
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
2 changed files with 4 additions and 1 deletions

View File

@ -815,7 +815,8 @@ module VagrantPlugins
disk_names = @disks.map { |d| d.name }
duplicate_names = disk_names.detect{ |d| disk_names.count(d) > 1 }
if duplicate_names && duplicate_names.size
errors << "Duplicate disk names found: #{duplicate_names}. Please use unique names"
errors << I18n.t("vagrant.config.vm.multiple_disk_names_error",
name: duplicate_names)
end
@disks.each do |d|

View File

@ -1905,6 +1905,8 @@ en:
Ignoring provider config for validation...
multiple_primary_disks_error: |-
There are more than one primary disks defined for guest '%{name}'. Please ensure that only one disk has been defined as a primary disk.
multiple_disk_names_error: |-
Duplicate disk names defined: '%{name}'. Disk names must be unique.
name_invalid: |-
The sub-VM name '%{name}' is invalid. Please don't use special characters.
network_ip_ends_in_one: |-