From 0a2141585318292c4a949a9fe6bd6dd27d601868 Mon Sep 17 00:00:00 2001 From: John Bieling Date: Mon, 3 May 2021 14:35:54 +0000 Subject: [PATCH] Bug 1708793 - Use brandShortName in Devtools when inspecting an add-on. r=jdescottes Differential Revision: https://phabricator.services.mozilla.com/D114010 --- devtools/client/framework/components/DebugTargetInfo.js | 6 +++++- .../__snapshots__/debug-target-info.test.js.snap | 4 ++-- devtools/client/locales/en-US/toolbox.properties | 7 ++++--- .../client/shared/test-helpers/jest-fixtures/Services.js | 9 +++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/devtools/client/framework/components/DebugTargetInfo.js b/devtools/client/framework/components/DebugTargetInfo.js index 781ae30cf639..e7cd9dfb3fd1 100644 --- a/devtools/client/framework/components/DebugTargetInfo.js +++ b/devtools/client/framework/components/DebugTargetInfo.js @@ -81,10 +81,14 @@ class DebugTargetInfo extends PureComponent { const { debugTargetData, L10N } = this.props; const { name, version } = debugTargetData.runtimeInfo; const { connectionType } = debugTargetData; + const brandShorterName = Services.strings + .createBundle("chrome://branding/locale/brand.properties") + .GetStringFromName("brandShorterName"); return connectionType === CONNECTION_TYPES.THIS_FIREFOX ? L10N.getFormatStr( - "toolbox.debugTargetInfo.runtimeLabel.thisFirefox", + "toolbox.debugTargetInfo.runtimeLabel.thisRuntime", + brandShorterName, version ) : L10N.getFormatStr( diff --git a/devtools/client/framework/test/node/components/__snapshots__/debug-target-info.test.js.snap b/devtools/client/framework/test/node/components/__snapshots__/debug-target-info.test.js.snap index db3d103e9455..4a912983b034 100644 --- a/devtools/client/framework/test/node/components/__snapshots__/debug-target-info.test.js.snap +++ b/devtools/client/framework/test/node/components/__snapshots__/debug-target-info.test.js.snap @@ -374,7 +374,7 @@ exports[`DebugTargetInfo component Target title renders the expected snapshot fo - toolbox.debugTargetInfo.runtimeLabel.thisFirefox-1.0.0 + toolbox.debugTargetInfo.runtimeLabel.thisRuntime-NodeTest-1.0.0 - toolbox.debugTargetInfo.runtimeLabel.thisFirefox-1.0.0 + toolbox.debugTargetInfo.runtimeLabel.thisRuntime-NodeTest-1.0.0 {} }, + strings: { + createBundle: function(bundle) { + return { + GetStringFromName: function(str) { + return "NodeTest"; + }, + }; + }, + }, }; function pref(name, value) {