mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 834721 - Use plurals for toolbox button tooltip; r=paul
This commit is contained in:
parent
3f10682513
commit
639c0b690a
@ -27,6 +27,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "CmdCommands",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PageErrorListener",
|
||||
"resource://gre/modules/devtools/WebConsoleUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
|
||||
"resource://gre/modules/PluralForm.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "prefBranch", function() {
|
||||
let prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService);
|
||||
@ -622,7 +625,19 @@ function DT__updateErrorsCount(aChangedTabId)
|
||||
let warnings = this._warningsCount[tabId];
|
||||
let btn = this._errorCounterButton;
|
||||
if (errors) {
|
||||
let tooltiptext = toolboxStrings.formatStringFromName("toolboxDockButtons.errorsCount.tooltip", [errors, warnings], 2);
|
||||
let errorsText = toolboxStrings
|
||||
.GetStringFromName("toolboxToggleButton.errorsCount");
|
||||
errorsText = PluralForm.get(errors, errorsText);
|
||||
|
||||
let warningsText = toolboxStrings
|
||||
.GetStringFromName("toolboxToggleButton.warningsCount");
|
||||
warningsText = PluralForm.get(warnings, warningsText);
|
||||
|
||||
let tooltiptext = toolboxStrings
|
||||
.formatStringFromName("toolboxToggleButton.tooltiptext",
|
||||
[errors, errorsText, warnings,
|
||||
warningsText], 4);
|
||||
|
||||
btn.setAttribute("error-count", errors);
|
||||
btn.setAttribute("tooltiptext", tooltiptext);
|
||||
} else {
|
||||
|
@ -44,7 +44,7 @@ function test() {
|
||||
|
||||
function getTooltipValues() {
|
||||
let matches = webconsole.getAttribute("tooltiptext")
|
||||
.match(/(\d+) errors, (\d+) warnings/);
|
||||
.match(/(\d+) errors?, (\d+) warnings?/);
|
||||
return matches ? [matches[1], matches[2]] : [0, 0];
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,10 @@
|
||||
toolboxDockButtons.bottom.tooltip=Dock to bottom of browser window
|
||||
toolboxDockButtons.side.tooltip=Dock to side of browser window
|
||||
toolboxDockButtons.window.tooltip=Show in separate window
|
||||
toolboxDockButtons.errorsCount.tooltip=%S errors, %S warnings.\nClick to toggle developer tools.
|
||||
|
||||
# LOCALIZATION NOTE (toolboxToggleButton): These strings are used for the button
|
||||
# that allows users to open/close the developer tools. You can find this button
|
||||
# on the developer toolbar.
|
||||
toolboxToggleButton.errorsCount=error;errors
|
||||
toolboxToggleButton.warningsCount=warning;warnings
|
||||
toolboxToggleButton.tooltiptext=%S %S, %S %S.\nClick to toggle the developer tools.
|
||||
|
Loading…
Reference in New Issue
Block a user