mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 05:47:53 +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"
|
||||
setup: "Setup a new configuration file"
|
||||
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:
|
||||
setup:
|
||||
title: "Serveur configuration"
|
||||
|
|
|
@ -118,6 +118,10 @@ fr:
|
|||
checkconfig: "Vérifie le fichier de configuration"
|
||||
setup: "Permet de générer un nouveau fichier de configuration"
|
||||
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:
|
||||
setup:
|
||||
title: "Configuration du serveur"
|
||||
|
|
|
@ -15,7 +15,6 @@ class Server
|
|||
# Constructor
|
||||
def initialize()
|
||||
YAML::ENGINE.yamler='syck'
|
||||
@error_msg = nil
|
||||
end
|
||||
|
||||
# Start the server
|
||||
|
@ -243,13 +242,20 @@ class Server
|
|||
@data_dir = config['config']['data_dir']
|
||||
@timeout = config['config']['timeout'].to_i
|
||||
|
||||
if @host.empty? || @port.empty?
|
||||
@error_msg = "Checkconfig failed!"
|
||||
if @host.empty? || @port.empty? || @data_dir.empty?
|
||||
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
|
||||
end
|
||||
|
||||
rescue Exception => e
|
||||
@error_msg = "Checkconfig failed!\n#{e}"
|
||||
puts "#{I18n.t('server.checkconfig.fail')}\n#{e}"
|
||||
return false
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue