mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 13:57:52 +00:00
translate checkconfig
This commit is contained in:
parent
8530f61b76
commit
c0751b3b25
3 changed files with 18 additions and 4 deletions
|
@ -118,6 +118,10 @@ en:
|
||||||
checkconfig: "Check the configuration"
|
checkconfig: "Check the configuration"
|
||||||
setup: "Setup a new configuration file"
|
setup: "Setup a new configuration file"
|
||||||
help: "Show this message help"
|
help: "Show this message help"
|
||||||
|
checkconfig:
|
||||||
|
fail: "Checkconfig failed:!"
|
||||||
|
empty: "ERROR: an importe option is missing!"
|
||||||
|
datadir: "ERROR: le data directory doesn't exist!"
|
||||||
form:
|
form:
|
||||||
setup:
|
setup:
|
||||||
title: "Serveur configuration"
|
title: "Serveur configuration"
|
||||||
|
|
|
@ -118,6 +118,10 @@ fr:
|
||||||
checkconfig: "Vérifie le fichier de configuration"
|
checkconfig: "Vérifie le fichier de configuration"
|
||||||
setup: "Permet de générer un nouveau fichier de configuration"
|
setup: "Permet de générer un nouveau fichier de configuration"
|
||||||
help: "Affiche ce message d'aide"
|
help: "Affiche ce message d'aide"
|
||||||
|
checkconfig:
|
||||||
|
fail: "Le fichier de configuration est invalide!"
|
||||||
|
empty: "ERREUR: Une option importante est manquante!"
|
||||||
|
datadir: "ERREUR: Le répertoire des données n'existe pas!"
|
||||||
form:
|
form:
|
||||||
setup:
|
setup:
|
||||||
title: "Configuration du serveur"
|
title: "Configuration du serveur"
|
||||||
|
|
|
@ -15,7 +15,6 @@ class Server
|
||||||
# Constructor
|
# Constructor
|
||||||
def initialize()
|
def initialize()
|
||||||
YAML::ENGINE.yamler='syck'
|
YAML::ENGINE.yamler='syck'
|
||||||
@error_msg = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Start the server
|
# Start the server
|
||||||
|
@ -243,13 +242,20 @@ class Server
|
||||||
@data_dir = config['config']['data_dir']
|
@data_dir = config['config']['data_dir']
|
||||||
@timeout = config['config']['timeout'].to_i
|
@timeout = config['config']['timeout'].to_i
|
||||||
|
|
||||||
if @host.empty? || @port.empty?
|
if @host.empty? || @port.empty? || @data_dir.empty?
|
||||||
@error_msg = "Checkconfig failed!"
|
puts I18n.t('server.checkconfig.fail')
|
||||||
|
puts I18n.t('server.checkconfig.empty')
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
if !Dir.exist?(@data_dir)
|
||||||
|
puts I18n.t('server.checkconfig.fail')
|
||||||
|
puts I18n.t('server.checkconfig.datadir')
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
@error_msg = "Checkconfig failed!\n#{e}"
|
puts "#{I18n.t('server.checkconfig.fail')}\n#{e}"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue