From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6636B1FF164 for ; Fri, 8 Nov 2024 14:05:10 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2258DDCC8; Fri, 8 Nov 2024 14:05:10 +0100 (CET) Date: Fri, 8 Nov 2024 14:04:36 +0100 From: Christoph Heiss To: Timothy Nicholson Message-ID: References: <20241108125254.147646-1-t.nicholson@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20241108125254.147646-1-t.nicholson@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH widget-toolkit] fix #5836: ui: translate systemd states in ServiceView X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Fri, Nov 08, 2024 at 01:52:54PM +0100, Timothy Nicholson wrote: > [..] > diff --git a/src/Utils.js b/src/Utils.js > index 7dd034a..23b0db5 100644 > --- a/src/Utils.js > +++ b/src/Utils.js > @@ -305,6 +305,17 @@ utilities: { > return Ext.htmlEncode(username); > }, > > + renderSystemdStatus: function(status) { > + switch (status) { > + case 'masked': > + return gettext('disabled'); Masked services are not the same as disabled, they have an important difference in meaning, IMHO. A *disabled* service does not start automatically on boot, but can still be manually started using e.g. `systemctl start .service`. A *masked* service cannot even be started manually, so even stricter than disabled. > + case 'not-found': > + return gettext('not installed'); > + default: > + return gettext(status); gettext() doesn't work that way, it needs the message as literal, as it just extracts the given string in the argument. See also proxmox-i18n/jsgettext.pl on how it works exactly. So you'd need to switch-case each state individually (unfortunately). > [..] > @@ -203,6 +197,10 @@ Ext.define('Proxmox.node.ServiceView', { > sortable: true, > hidden: !Ext.Array.contains(['PVEAuthCookie', 'PBSAuthCookie'], Proxmox?.Setup?.auth_cookie_name), > dataIndex: 'unit-state', > + renderer: (value, meta, rec) => { > + const unitState = rec.get('unit-state'); > + return gettext(unitState); Same as above. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel