Bug 1574763 - Localize the WarningGroup badge title. r=jdescottes.

Sadly the badge title wasn't localized at all, so we add a new
l10n string and use it in the component.

Differential Revision: https://phabricator.services.mozilla.com/D42517

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Chevobbe 2019-08-20 05:52:40 +00:00
Родитель cd45ead7b7
Коммит 2133561d3b
2 изменённых файлов: 16 добавлений и 1 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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
),