From 01a89bc29ac5602d53c0e291f20ac29331286bf9 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 4 Feb 2023 12:25:01 -0300 Subject: [PATCH] status/network: Improve network toggle subtitles If there is a single connection for a given NMToggle subclass, use the connection name; otherwise, transform that into '%d connected'. This is better than the current "Device (counter)" template, e.g. "VPN (2)", which would give us a quick toggle with: VPN VPN (2) Change that to e.g.: VPN 2 connected Part-of: --- js/ui/status/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 781e298a4..2fa08cca9 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1363,13 +1363,13 @@ const NMToggle = GObject.registerClass({ // transform function for property binding: // Ignore the provided label if there are multiple active - // items, and replace it with something like "VPN (2)" + // items, and replace it with something like "2 connected" _transformSubtitle(source) { const nActive = this.checked ? [...this._getActiveItems()].length : 0; if (nActive > 1) - return `${this._getDefaultName()} (${nActive})`; + return ngettext('%d connected', '%d connected', nActive).format(nActive); return source; }