From 50aa7713f47fd3cd7765190fe2c30eab843656ed Mon Sep 17 00:00:00 2001 From: Adrien Waksberg Date: Mon, 30 Jan 2017 20:29:42 +0100 Subject: [PATCH] fix error message when host is empty --- i18n/en.yml | 2 +- i18n/fr.yml | 2 +- lib/mpw/item.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/en.yml b/i18n/en.yml index e1ffcf7..252efee 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -22,7 +22,7 @@ en: write_data: "Can't to write the MPW file!" import: "Can't import, unable to read %{file}!" update: - name_empty: "You must define a name!" + host_empty: "You must define a host!" sync: general: "An error has appeared during the sync" connection: "Connection fail!" diff --git a/i18n/fr.yml b/i18n/fr.yml index 82e5af3..16160cd 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -22,7 +22,7 @@ fr: write_data: "Impossible d'écrire le fichier MPW!" import: "Impossible d'importer le fichier %{file}, car il n'est pas lisible!" update: - name_empty: "Vous devez définir un nom!" + host_empty: "Vous devez définir un host!" sync: general: "Une erreur est survenue durant la synchronisation" connection: "La connexion n'a pu être établie!" diff --git a/lib/mpw/item.rb b/lib/mpw/item.rb index 4beb49f..d3783b9 100644 --- a/lib/mpw/item.rb +++ b/lib/mpw/item.rb @@ -39,7 +39,7 @@ class Item # raise an error if the hash hasn't the key name def initialize(options={}) if not options.has_key?(:host) or options[:host].to_s.empty? - raise I18n.t('error.update.name_empty') + raise I18n.t('error.update.host_empty') end if not options.has_key?(:id) or options[:id].to_s.empty? or not options.has_key?(:created) or options[:created].to_s.empty? @@ -59,7 +59,7 @@ class Item # @args: options -> a hash of parameter def update(options={}) if options.has_key?(:host) and options[:host].to_s.empty? - raise I18n.t('error.update.name_empty') + raise I18n.t('error.update.host_empty') end @group = options[:group] if options.has_key?(:group)