diff --git a/browser/base/content/test/static/browser_misused_characters_in_strings.js b/browser/base/content/test/static/browser_misused_characters_in_strings.js index 76390ec34091..1145af17ea9b 100644 --- a/browser/base/content/test/static/browser_misused_characters_in_strings.js +++ b/browser/base/content/test/static/browser_misused_characters_in_strings.js @@ -156,6 +156,10 @@ let gWhitelist = [{ file: "aboutNetworking.dtd", key: "aboutNetworking.logTutorial", type: "single-quote", + }, { + file: "aboutdevtools.dtd", + key: "aboutDevtools.newsletter.privacy.label", + type: "single-quote", }, { file: "browser.dtd", key: "addonPostInstallMessage.label", diff --git a/devtools/startup/aboutdevtools/aboutdevtools.js b/devtools/startup/aboutdevtools/aboutdevtools.js index 4dd4144341b3..2efb1566cee4 100644 --- a/devtools/startup/aboutdevtools/aboutdevtools.js +++ b/devtools/startup/aboutdevtools/aboutdevtools.js @@ -31,6 +31,9 @@ const GA_PARAMETERS = [ ["utm_medium", "onboarding"], ]; +const ABOUTDEVTOOLS_STRINGS = "chrome://devtools-startup/locale/aboutdevtools.properties"; +const aboutDevtoolsBundle = Services.strings.createBundle(ABOUTDEVTOOLS_STRINGS); + const KEY_SHORTCUTS_STRINGS = "chrome://devtools-startup/locale/key-shortcuts.properties"; const keyShortcutsBundle = Services.strings.createBundle(KEY_SHORTCUTS_STRINGS); @@ -80,55 +83,55 @@ function updatePage() { * Array of descriptors for features displayed on about:devtools. * Each feature should contain: * - icon: the name of the image to use - * - title: the key of the localized title (from aboutDevTools.ftl) - * - desc: the key of the localized description (from aboutDevTools.ftl) + * - title: the key of the localized title (from aboutdevtools.properties) + * - desc: the key of the localized description (from aboutdevtools.properties) * - link: the MDN documentation link */ const features = [ { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-inspector.svg", - title: "features-inspector-title", - desc: "features-inspector-desc", + title: "features.inspector.title", + desc: "features.inspector.desc", link: "https://developer.mozilla.org/docs/Tools/Page_Inspector", }, { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-console.svg", - title: "features-console-title", - desc: "features-console-desc", + title: "features.console.title", + desc: "features.console.desc", link: "https://developer.mozilla.org/docs/Tools/Web_Console", }, { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-debugger.svg", - title: "features-debugger-title", - desc: "features-debugger-desc", + title: "features.debugger.title", + desc: "features.debugger.desc", link: "https://developer.mozilla.org/docs/Tools/Debugger", }, { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-network.svg", - title: "features-network-title", - desc: "features-network-desc", + title: "features.network.title", + desc: "features.network.desc", link: "https://developer.mozilla.org/docs/Tools/Network_Monitor", }, { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-storage.svg", - title: "features-storage-title", - desc: "features-storage-desc", + title: "features.storage.title", + desc: "features.storage.desc", link: "https://developer.mozilla.org/docs/Tools/Storage_Inspector", }, { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-responsive.svg", - title: "features-responsive-title", - desc: "features-responsive-desc", + title: "features.responsive.title", + desc: "features.responsive.desc", link: "https://developer.mozilla.org/docs/Tools/Responsive_Design_Mode", }, { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-visualediting.svg", - title: "features-visual-editing-title", - desc: "features-visual-editing-desc", + title: "features.visualediting.title", + desc: "features.visualediting.desc", link: "https://developer.mozilla.org/docs/Tools/Style_Editor", }, { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-performance.svg", - title: "features-performance-title", - desc: "features-performance-desc", + title: "features.performance.title", + desc: "features.performance.desc", link: "https://developer.mozilla.org/docs/Tools/Performance", }, { icon: "chrome://devtools-startup/content/aboutdevtools/images/feature-memory.svg", - title: "features-memory-title", - desc: "features-memory-desc", + title: "features.memory.title", + desc: "features.memory.desc", link: "https://developer.mozilla.org/docs/Tools/Memory", }, ]; @@ -139,17 +142,20 @@ const features = [ function createFeatureEl(feature) { const li = document.createElement("li"); li.classList.add("feature"); + const learnMore = aboutDevtoolsBundle.GetStringFromName("features.learnMore"); - const {icon, link, title, desc} = feature; + let {icon, link, title, desc} = feature; + title = aboutDevtoolsBundle.GetStringFromName(title); + desc = aboutDevtoolsBundle.GetStringFromName(desc); // eslint-disable-next-line no-unsanitized/property li.innerHTML = ` -

-

- +

${title}

+

+ ${desc} + ${learnMore}

`; return li; @@ -159,10 +165,10 @@ window.addEventListener("load", function() { const inspectorShortcut = getToolboxShortcut(); const welcomeMessage = document.getElementById("welcome-message"); - // Set the welcome message content with the correct keyboard shortcut for the current + // Set the welcome message content with the correct keyboard sortcut for the current // platform. - document.l10n.setAttributes(welcomeMessage, "welcome-message", - { shortcut: inspectorShortcut }); + welcomeMessage.textContent = aboutDevtoolsBundle.formatStringFromName("welcome.message", + [inspectorShortcut], 1); // Set the appropriate title message. if (reason == "ContextMenu") { diff --git a/devtools/startup/aboutdevtools/aboutdevtools.xhtml b/devtools/startup/aboutdevtools/aboutdevtools.xhtml index 5ff806e12556..3672e2944700 100644 --- a/devtools/startup/aboutdevtools/aboutdevtools.xhtml +++ b/devtools/startup/aboutdevtools/aboutdevtools.xhtml @@ -5,39 +5,39 @@ %htmlDTD; %globalDTD; + %aboutdevtoolsDTD; ]> - + &aboutDevtools.headTitle; a -