diff --git a/locales/en.json b/locales/en.json index 02ddc02a2..acd734b1d 100644 --- a/locales/en.json +++ b/locales/en.json @@ -117,6 +117,11 @@ "service_status_failed" : "Unable to determine status of service '{:s}'", "service_no_log" : "No log to display for service '{:s}'", "service_cmd_exec_failed" : "Unable to execute command '{:s}'", + "services_configured": "Configuration successfully generated", + "service_configuration_conflict": "The file {file:s} has been changed since its last generation. Please apply the modifications manually or use the option --force (it will erase all the modifications previously done to the file)", + "no_such_conf_file": "Unable to copy the file {file:s}: the file does not exist", + "service_add_configuration": "Adding the configuration file {file:s}", + "network_check_smtp_ok" : "Outbound mail (SMTP port 25) is not blocked", "network_check_smtp_ko" : "Outbound mail (SMTP port 25) seems to be blocked by your network", diff --git a/locales/fr.json b/locales/fr.json index 86ab7fbf9..0fe221e3c 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -149,6 +149,10 @@ "service_stop_failed": "Impossible d'arrêter le service '{:s}'", "service_stopped": "Service '{:s}' arrêté avec succès", "service_unknown": "Service '{:s}' inconnu", + "services_configured": "La configuration a été générée avec succès", + "service_configuration_conflict": "Le fichier {file:s} a été modifié depuis sa dernière génération. Veuillez y appliquer les modifications manuellement ou utiliser l’option --force (ce qui écrasera toutes les modifications effectuées sur le fichier)", + "no_such_conf_file": "Le fichier {file:s} n’existe pas, il ne peut pas être copié", + "service_add_configuration": "Ajout du fichier de configuration {file:s}", "ssowat_conf_generated": "Configuration de SSOwat générée avec succès", "ssowat_conf_updated": "Configuration persistante de SSOwat mise à jour avec succès", "system_upgraded": "Système mis à jour avec succès", diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 2a69b4d2d..4292fbac7 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -470,7 +470,7 @@ def service_saferemove(service, conf_file, force=False): if os.isatty(1) and \ (len(previous_hash) == 32 or previous_hash[-32:] != current_hash): msignals.display( - m18n.n('service_configuration_changed', conf_file), + m18n.n('service_configuration_conflict', file=conf_file), 'warning' ) @@ -495,7 +495,7 @@ def service_safecopy(service, new_conf_file, conf_file, force=False): services = _get_services() if not os.path.exists(new_conf_file): - raise MoulinetteError(errno.EIO, m18n.n('no_such_conf_file', new_conf_file)) + raise MoulinetteError(errno.EIO, m18n.n('no_such_conf_file', file=new_conf_file)) with open(new_conf_file, 'r') as f: new_conf = ''.join(f.readlines()).rstrip() @@ -509,7 +509,7 @@ def service_safecopy(service, new_conf_file, conf_file, force=False): ) process.wait() else: - msignals.display(m18n.n('service_add_configuration', conf_file), + msignals.display(m18n.n('service_add_configuration', file=conf_file), 'info') # Add the service if it does not exist @@ -540,7 +540,7 @@ def service_safecopy(service, new_conf_file, conf_file, force=False): new_hash = previous_hash if (len(previous_hash) == 32 or previous_hash[-32:] != current_hash): msignals.display( - m18n.n('service_configuration_conflict', conf_file), + m18n.n('service_configuration_conflict', file=conf_file), 'warning' ) print('\n' + conf_file)