diff --git a/devtools/client/locales/en-US/webconsole.properties b/devtools/client/locales/en-US/webconsole.properties index d4bc30d67626..a5ac993e454b 100644 --- a/devtools/client/locales/en-US/webconsole.properties +++ b/devtools/client/locales/en-US/webconsole.properties @@ -439,3 +439,12 @@ webconsole.editor.toolbar.closeButton.tooltip=Close Editor (%S) # displayed when the console is in regular mode. # Parameters: %S is the keyboard shortcut. webconsole.input.openEditorButton.tooltip=Open Editor (%S) + +# LOCALIZATION NOTE (webconsole.warningGroup.messageCount.tooltip): the tooltip text +# displayed when you hover a warning group badge (i.e. repeated warning messages for a +# given category, for example Content Blocked messages) in the web console output. +# This is a semi-colon list of plural forms. +# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals +# #1 number of message in the group. +# example: 3 messages +webconsole.warningGroup.messageCount.tooltip=#1 message;#1 messages diff --git a/devtools/client/webconsole/components/Output/message-types/WarningGroup.js b/devtools/client/webconsole/components/Output/message-types/WarningGroup.js index 149f268038ab..7ff17d24c52b 100644 --- a/devtools/client/webconsole/components/Output/message-types/WarningGroup.js +++ b/devtools/client/webconsole/components/Output/message-types/WarningGroup.js @@ -13,6 +13,12 @@ const Message = createFactory( require("devtools/client/webconsole/components/Output/Message") ); +const { PluralForm } = require("devtools/shared/plural-form"); +const { l10n } = require("devtools/client/webconsole/utils/messages"); +const messageCountTooltip = l10n.getStr( + "webconsole.warningGroup.messageCount.tooltip" +); + WarningGroup.displayName = "WarningGroup"; WarningGroup.propTypes = { @@ -41,7 +47,7 @@ function WarningGroup(props) { dom.span( { className: "warning-group-badge", - title: `${badge} messages`, + title: PluralForm.get(badge, messageCountTooltip).replace("#1", badge), }, badge ),