From 02842b311d19e1ef403c5b501896ae619628896c Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 17 May 2018 06:00:04 +0200 Subject: [PATCH 1/4] [enh] add service descriptions to en.json --- locales/en.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/locales/en.json b/locales/en.json index 86f36749b..3e64b1973 100644 --- a/locales/en.json +++ b/locales/en.json @@ -335,6 +335,24 @@ "service_conf_up_to_date": "The configuration is already up-to-date for service '{service}'", "service_conf_updated": "The configuration has been updated for service '{service}'", "service_conf_would_be_updated": "The configuration would have been updated for service '{service}'", + "service_description_avahi-daemon": "Avahi mDNS/DNS-SD Stack", + "service_description_dnsmasq": "dnsmasq - A lightweight DHCP and caching DNS server", + "service_description_dovecot": "Dovecot IMAP/POP3 email server", + "service_description_fail2ban": "Start/stop fail2ban", + "service_description_glances": "Starts and daemonize Glances server", + "service_description_metronome": "Metronome XMPP Server", + "service_description_mysql": "Start and stop the mysql database server daemon", + "service_description_nginx": "A high performance web server and a reverse proxy server", + "service_description_nslcd": "LDAP connection daemon", + "service_description_php5-fpm": "The PHP FastCGI Process Manager", + "service_description_postfix": "Postfix Mail Transport Agent", + "service_description_redis-server": "Advanced key-value store", + "service_description_rmilter": "Another sendmail milter for different mail checks", + "service_description_rspamd": "rapid spam filtering system", + "service_description_slapd": "OpenLDAP standalone server (Lightweight Directory Access Protocol)", + "service_description_ssh": "OpenBSD Secure Shell server", + "service_description_yunohost-api": "YunoHost API Server", + "service_description_yunohost-firewall": "YunoHost Firewall", "service_disable_failed": "Unable to disable service '{service:s}'\n\nRecent service logs:{logs:s}", "service_disabled": "The service '{service:s}' has been disabled", "service_enable_failed": "Unable to enable service '{service:s}'\n\nRecent service logs:{logs:s}", From 357be33583f6b23a50853fd3f85dc83a81b11114 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 17 May 2018 06:20:01 +0200 Subject: [PATCH 2/4] [enh] uses services descriptions translatables --- src/yunohost/service.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index d02adc083..96fd8ff92 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -227,6 +227,15 @@ def service_status(names=[]): status = _get_service_information_from_systemd(name) + translation_key = "service_description_%s" % name + description = m18n.n(translation_key) + + # that mean that we don't have a translation for this string + # that's the only way to test for that for now + # if we don't have it, uses the one provide by systemd + if description == translation_key: + description = str(status.get("Description", "")) + result[name] = { 'status': str(status.get("SubState", "unknown")), 'loaded': "enabled" if str(status.get("LoadState", "unknown")) == "loaded" else str(status.get("LoadState", "unknown")), @@ -235,7 +244,7 @@ def service_status(names=[]): "timestamp": str(status.get("ActiveEnterTimestamp", "unknown")), "human": datetime.fromtimestamp(status.get("ActiveEnterTimestamp") / 1000000).strftime("%F %X"), }, - 'description': str(status.get("Description", "")), + 'description': description, 'service_file_path': str(status.get("FragmentPath", "unknown")), } From 72bd201cb2efc5f67df29a2eb6384e2a5770fc3f Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 18 May 2018 04:31:09 +0200 Subject: [PATCH 3/4] [enh] import services descriptions from https://pad.aquilenet.fr/p/8Cg5Miv6Of Thanks to everyone who contributed <3 Co-authored-by: ariasuni Co-authored-by: Haelwenn (lanodan) Monnier --- locales/en.json | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/locales/en.json b/locales/en.json index 3e64b1973..e7bfd2ded 100644 --- a/locales/en.json +++ b/locales/en.json @@ -335,24 +335,24 @@ "service_conf_up_to_date": "The configuration is already up-to-date for service '{service}'", "service_conf_updated": "The configuration has been updated for service '{service}'", "service_conf_would_be_updated": "The configuration would have been updated for service '{service}'", - "service_description_avahi-daemon": "Avahi mDNS/DNS-SD Stack", - "service_description_dnsmasq": "dnsmasq - A lightweight DHCP and caching DNS server", - "service_description_dovecot": "Dovecot IMAP/POP3 email server", - "service_description_fail2ban": "Start/stop fail2ban", - "service_description_glances": "Starts and daemonize Glances server", - "service_description_metronome": "Metronome XMPP Server", - "service_description_mysql": "Start and stop the mysql database server daemon", - "service_description_nginx": "A high performance web server and a reverse proxy server", - "service_description_nslcd": "LDAP connection daemon", - "service_description_php5-fpm": "The PHP FastCGI Process Manager", - "service_description_postfix": "Postfix Mail Transport Agent", - "service_description_redis-server": "Advanced key-value store", - "service_description_rmilter": "Another sendmail milter for different mail checks", - "service_description_rspamd": "rapid spam filtering system", - "service_description_slapd": "OpenLDAP standalone server (Lightweight Directory Access Protocol)", - "service_description_ssh": "OpenBSD Secure Shell server", - "service_description_yunohost-api": "YunoHost API Server", - "service_description_yunohost-firewall": "YunoHost Firewall", + "service_description_avahi-daemon": "allows to reach your server using yunohost.local on your local network", + "service_description_dnsmasq": "handles domain name resolution (DNS)", + "service_description_dovecot": "allows e-mail client to access/fetch email (via IMAP and POP3)", + "service_description_fail2ban": "protects against bruteforce and other kind of attacks from the Internet", + "service_description_glances": "monitors system information on your server", + "service_description_metronome": "manage XMPP instant messaging accounts", + "service_description_mysql": "stores applications data (SQL database)", + "service_description_nginx": "serves or provides access to all the websites hosted on your server", + "service_description_nslcd": "handles YunoHost user shell connection", + "service_description_php5-fpm": "runs applications written in PHP with nginx", + "service_description_postfix": "used to send and receive emails", + "service_description_redis-server": "a specialized database used for rapid data access, task queue and communication between programs", + "service_description_rmilter": "checks various parameters in emails", + "service_description_rspamd": "filters spam, and other email-related features", + "service_description_slapd": "stores users, domains and related information", + "service_description_ssh": "allows you to connect remotely to your server via a terminal (SSH protocol)", + "service_description_yunohost-api": "manages interactions between the YunoHost web interface and the system", + "service_description_yunohost-firewall": "manages open and close connexion ports to services", "service_disable_failed": "Unable to disable service '{service:s}'\n\nRecent service logs:{logs:s}", "service_disabled": "The service '{service:s}' has been disabled", "service_enable_failed": "Unable to enable service '{service:s}'\n\nRecent service logs:{logs:s}", From 23474558fcca8234d7ea3c18c80e63427df6cdc0 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 18 May 2018 04:38:11 +0200 Subject: [PATCH 4/4] [mod] anglish --- src/yunohost/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 96fd8ff92..69b2bb9fc 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -232,7 +232,7 @@ def service_status(names=[]): # that mean that we don't have a translation for this string # that's the only way to test for that for now - # if we don't have it, uses the one provide by systemd + # if we don't have it, uses the one provided by systemd if description == translation_key: description = str(status.get("Description", ""))