utils: never translate systemd unit states

Translating unit states might be counter productive in case of
debugging, opt for not translating them and drop usage of the
translation helper.

This was spotted by several devs on doing translations in languages
they know, so it really seems not right to add.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
 [ TL: add last sentence to add some weight to not doing that ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Christian Ebner 2024-11-19 14:02:53 +01:00 committed by Thomas Lamprecht
parent 2686922392
commit 461298d80a
2 changed files with 2 additions and 20 deletions

View File

@ -306,18 +306,6 @@ utilities: {
return Ext.htmlEncode(username);
},
systemdStates: {
'enabled': gettext('enabled'),
'disabled': gettext('disabled'),
'running': gettext('running'),
'dead': gettext('dead'),
'not-found': gettext('not installed'),
'static': gettext('static'),
'reload': gettext('reload'),
'start': gettext('starting'),
'stop': gettext('stopping'),
},
getStoredAuth: function() {
let storedAuth = JSON.parse(window.localStorage.getItem('ProxmoxUser'));
return storedAuth || {};

View File

@ -201,10 +201,7 @@ Ext.define('Proxmox.node.ServiceView', {
width: 100,
sortable: true,
dataIndex: 'state',
renderer: (value, meta, rec) => {
const state = rec.get('state');
return Proxmox.Utils.systemdStates[state] ?? state;
},
renderer: (value, meta, rec) => rec.get('state'),
},
{
header: gettext('Active'),
@ -219,10 +216,7 @@ 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 Proxmox.Utils.systemdStates[unitState] ?? unitState;
},
renderer: (value, meta, rec) => rec.get('unit-state'),
},
{
header: gettext('Description'),