Bug 834721 - Use plurals for toolbox button tooltip; r=paul f=l10n
authorMihai Sucan <mihai.sucan@gmail.com>
Fri, 15 Feb 2013 23:29:44 +0200
changeset 122276 5d7a14c71f51454dfce3250e9a957ff432e37280
parent 122275 c080abd4eb7ad97826149d053aa0b2efb9646249
child 122277 300311c8e0eb169e1f2a44c0881e299805c76f4c
push id24328
push userttaubert@mozilla.com
push dateTue, 19 Feb 2013 09:39:45 +0000
treeherdermozilla-central@3f0f2fc4bd0f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs834721
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 834721 - Use plurals for toolbox button tooltip; r=paul f=l10n
browser/devtools/shared/DeveloperToolbar.jsm
browser/locales/en-US/chrome/browser/devtools/toolbox.properties
--- a/browser/devtools/shared/DeveloperToolbar.jsm
+++ b/browser/devtools/shared/DeveloperToolbar.jsm
@@ -621,27 +621,26 @@ function DT__updateErrorsCount(aChangedT
     return;
   }
 
   let errors = this._errorsCount[tabId];
   let warnings = this._warningsCount[tabId];
   let btn = this._errorCounterButton;
   if (errors) {
     let errorsText = toolboxStrings
-                     .GetStringFromName("toolboxToggleButton.errorsCount");
-    errorsText = PluralForm.get(errors, errorsText);
+                     .GetStringFromName("toolboxToggleButton.errors");
+    errorsText = PluralForm.get(errors, errorsText).replace("#1", errors);
 
     let warningsText = toolboxStrings
-                       .GetStringFromName("toolboxToggleButton.warningsCount");
-    warningsText = PluralForm.get(warnings, warningsText);
+                       .GetStringFromName("toolboxToggleButton.warnings");
+    warningsText = PluralForm.get(warnings, warningsText).replace("#1", warnings);
 
     let tooltiptext = toolboxStrings
-                      .formatStringFromName("toolboxToggleButton.tooltiptext",
-                                            [errors, errorsText, warnings,
-                                             warningsText], 4);
+                      .formatStringFromName("toolboxToggleButton.tooltip",
+                                            [errorsText, warningsText], 2);
 
     btn.setAttribute("error-count", errors);
     btn.setAttribute("tooltiptext", tooltiptext);
   } else {
     btn.removeAttribute("error-count");
     btn.setAttribute("tooltiptext", btn._defaultTooltipText);
   }
 };
--- a/browser/locales/en-US/chrome/browser/devtools/toolbox.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/toolbox.properties
@@ -1,10 +1,22 @@
 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
 
-# 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.
+# LOCALIZATION NOTE (toolboxToggleButton.errors): Semi-colon list of plural
+# forms.
+# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
+# #1 number of errors in the current web page
+toolboxToggleButton.errors=#1 error;#1 errors
+
+# LOCALIZATION NOTE (toolboxToggleButton.warnings): Semi-colon list of plural
+# forms.
+# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
+# #1 number of warnings in the current web page
+toolboxToggleButton.warnings=#1 warning;#1 warnings
+
+# LOCALIZATION NOTE (toolboxToggleButton.tooltip): This string is shown
+# as tooltip in the developer toolbar to open/close the developer tools.
+# It's using toolboxToggleButton.errors as first and
+# toolboxToggleButton.warnings as second argument to show the number of errors
+# and warnings.
+toolboxToggleButton.tooltip=%1$S, %2$S\nClick to toggle the developer tools.