Bug 1184307 - Performance graphs use hardcoded strings for min, max, avg. r=jsantell
authorLin Clark <lin.w.clark@gmail.com>
Mon, 17 Aug 2015 11:58:36 -0400
changeset 285588 b8e7689d9b8e08a4c719a0d28d5366c980698d2e
parent 285587 2534ceef7946c4fb5c04601f87b8624c03e8de3b
child 285589 5161d574297a1fbd0fba5fa91fbe14f186e996e4
push id4466
push usernalexander@mozilla.com
push dateMon, 17 Aug 2015 16:51:24 +0000
reviewersjsantell
bugs1184307
milestone43.0a1
Bug 1184307 - Performance graphs use hardcoded strings for min, max, avg. r=jsantell
browser/devtools/shared/widgets/LineGraphWidget.js
browser/locales/en-US/chrome/browser/devtools/graphs.properties
browser/locales/jar.mn
--- a/browser/devtools/shared/widgets/LineGraphWidget.js
+++ b/browser/devtools/shared/widgets/LineGraphWidget.js
@@ -2,17 +2,17 @@
 
 const { Cc, Ci, Cu, Cr } = require("chrome");
 
 const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 const { ViewHelpers, Heritage } = require("resource:///modules/devtools/ViewHelpers.jsm");
 const { AbstractCanvasGraph, CanvasGraphUtils } = require("devtools/shared/widgets/Graphs");
 
 const HTML_NS = "http://www.w3.org/1999/xhtml";
-const L10N = new ViewHelpers.L10N();
+const L10N = new ViewHelpers.L10N("chrome://browser/locale/devtools/graphs.properties");
 
 // Line graph constants.
 
 const GRAPH_DAMPEN_VALUES_FACTOR = 0.85;
 const GRAPH_TOOLTIP_SAFE_BOUNDS = 8; // px
 const GRAPH_MIN_MAX_TOOLTIP_DISTANCE = 14; // px
 
 const GRAPH_BACKGROUND_COLOR = "#0088cc";
@@ -71,21 +71,21 @@ this.LineGraphWidget = function(parent, 
 
   AbstractCanvasGraph.apply(this, [parent, "line-graph", ...args]);
 
   this.once("ready", () => {
     // Create all gutters and tooltips incase the showing of min/max/avg
     // are changed later
     this._gutter = this._createGutter();
     this._maxGutterLine = this._createGutterLine("maximum");
-    this._maxTooltip = this._createTooltip("maximum", "start", "max", metric);
+    this._maxTooltip = this._createTooltip("maximum", "start", L10N.getStr("graphs.label.maximum"), metric);
     this._minGutterLine = this._createGutterLine("minimum");
-    this._minTooltip = this._createTooltip("minimum", "start", "min", metric);
+    this._minTooltip = this._createTooltip("minimum", "start", L10N.getStr("graphs.label.minimum"), metric);
     this._avgGutterLine = this._createGutterLine("average");
-    this._avgTooltip = this._createTooltip("average", "end", "avg", metric);
+    this._avgTooltip = this._createTooltip("average", "end", L10N.getStr("graphs.label.average"), metric);
   });
 };
 
 LineGraphWidget.prototype = Heritage.extend(AbstractCanvasGraph.prototype, {
   backgroundColor: GRAPH_BACKGROUND_COLOR,
   backgroundGradientStart: GRAPH_BACKGROUND_GRADIENT_START,
   backgroundGradientEnd: GRAPH_BACKGROUND_GRADIENT_END,
   strokeColor: GRAPH_STROKE_COLOR,
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/chrome/browser/devtools/graphs.properties
@@ -0,0 +1,24 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# LOCALIZATION NOTE These strings are used inside the Performance Tools
+# which is available from the Web Developer sub-menu -> 'Performance'.
+# The correct localization of this file might be to keep it in
+# English, or another language commonly spoken among web developers.
+# You want to make that choice consistent across the developer tools.
+# A good criteria is the language in which you'd find the best
+# documentation on web development on the web. These strings
+# are specifically for marker names in the performance tool.
+
+# LOCALIZATION NOTE (graphs.label.average):
+# This string is displayed on graphs when showing an average.
+graphs.label.average=avg
+
+# LOCALIZATION NOTE (graphs.label.minimum):
+# This string is displayed on graphs when showing a minimum.
+graphs.label.minimum=min
+
+# LOCALIZATION NOTE (graphs.label.maximum):
+# This string is displayed on graphs when showing a maximum.
+graphs.label.maximum=max
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -58,16 +58,17 @@
     locale/browser/devtools/webConsole.dtd            (%chrome/browser/devtools/webConsole.dtd)
     locale/browser/devtools/VariablesView.dtd         (%chrome/browser/devtools/VariablesView.dtd)
     locale/browser/devtools/sourceeditor.properties   (%chrome/browser/devtools/sourceeditor.properties)
     locale/browser/devtools/sourceeditor.dtd          (%chrome/browser/devtools/sourceeditor.dtd)
     locale/browser/devtools/promisedebugger.dtd       (%chrome/browser/devtools/promisedebugger.dtd)
     locale/browser/devtools/promisedebugger.properties  (%chrome/browser/devtools/promisedebugger.properties)
     locale/browser/devtools/performance.dtd           (%chrome/browser/devtools/performance.dtd)
     locale/browser/devtools/performance.properties    (%chrome/browser/devtools/performance.properties)
+    locale/browser/devtools/graphs.properties         (%chrome/browser/devtools/graphs.properties)
     locale/browser/devtools/layoutview.dtd            (%chrome/browser/devtools/layoutview.dtd)
     locale/browser/devtools/responsiveUI.properties   (%chrome/browser/devtools/responsiveUI.properties)
     locale/browser/devtools/toolbox.dtd            (%chrome/browser/devtools/toolbox.dtd)
     locale/browser/devtools/toolbox.properties     (%chrome/browser/devtools/toolbox.properties)
     locale/browser/devtools/inspector.dtd          (%chrome/browser/devtools/inspector.dtd)
     locale/browser/devtools/markers.properties     (%chrome/browser/devtools/markers.properties)
     locale/browser/devtools/projecteditor.properties     (%chrome/browser/devtools/projecteditor.properties)
     locale/browser/devtools/eyedropper.properties     (%chrome/browser/devtools/eyedropper.properties)