From: Lukas Wagner <l.wagner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Timothy Nicholson <t.nicholson@proxmox.com>
Subject: Re: [pve-devel] [PATCH widget-toolkit] fix #5836: ui: translate systemd states in ServiceView
Date: Fri, 8 Nov 2024 14:02:26 +0100 [thread overview]
Message-ID: <d553387f-8884-49cb-b303-e2466405d567@proxmox.com> (raw)
In-Reply-To: <20241108125254.147646-1-t.nicholson@proxmox.com>
Thanks for giving this a shot!
One comment inline
On 2024-11-08 13:52, Timothy Nicholson wrote:
> With this patch, all systemd states and unit states in the service
> view use gettext to be translated.
>
> Signed-off-by: Timothy Nicholson <t.nicholson@proxmox.com>
> ---
> As stated in the Bugzilla entry [0]: Up until now, only two
> systemd states were translated. This patch changes this so all
> systemd states use gettext and are translated. For some of the
> states, translations need to be added.
> [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=5836
>
> src/Utils.js | 11 +++++++++++
> src/node/ServiceView.js | 14 ++++++--------
> 2 files changed, 17 insertions(+), 8 deletions(-)
>
> 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');
> + case 'not-found':
> + return gettext('not installed');
> + default:
> + return gettext(status);
While the gettext function itself will gladly accept a string passed
in from a variable, the script extracting translatable strings [1] expects
a literal string that will be used as a reference for translations.
[1] https://git.proxmox.com/?p=proxmox-i18n.git;a=blob;f=jsgettext.pl;h=7f758fd9e5b3f5f7e0fb0c2ca0f46690df59dd58;hb=HEAD
--
- Lukas
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2024-11-08 13:03 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 [this message]
2024-11-08 13:04 ` Christoph Heiss
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=d553387f-8884-49cb-b303-e2466405d567@proxmox.com \
--to=l.wagner@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.