all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: Timothy Nicholson <t.nicholson@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH widget-toolkit] fix #5836: ui: translate systemd states in ServiceView
Date: Fri, 8 Nov 2024 14:04:36 +0100	[thread overview]
Message-ID: <pxgkoys6mpqbcnd4evrdin2md6ftmqblk5epzb2f3ceqgxw5wm@jiukqzqneuti> (raw)
In-Reply-To: <20241108125254.147646-1-t.nicholson@proxmox.com>

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 <name>.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


      parent reply	other threads:[~2024-11-08 13:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 12:52 Timothy Nicholson
2024-11-08 13:02 ` Lukas Wagner
2024-11-08 13:04 ` Christoph Heiss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pxgkoys6mpqbcnd4evrdin2md6ftmqblk5epzb2f3ceqgxw5wm@jiukqzqneuti \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.nicholson@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal