зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1258305 - Update all occurences of ViewHelpers.L10N and MultiL10N to use the new module, r=jsantell
This commit is contained in:
Родитель
a994b4a225
Коммит
1cfbac47ef
|
@ -23,8 +23,10 @@ loader.lazyRequireGetter(this, "promise");
|
|||
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
|
||||
loader.lazyRequireGetter(this, "AnimationsFront", "devtools/server/actors/animation", true);
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/animationinspector.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
// Global toolbox/inspector, set when startup is called.
|
||||
var gToolbox, gInspector;
|
||||
|
|
|
@ -10,8 +10,10 @@ const {Cu} = require("chrome");
|
|||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
const {createNode, TimeScale} = require("devtools/client/animationinspector/utils");
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/animationinspector.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
/**
|
||||
* UI component responsible for displaying a single animation timeline, which
|
||||
|
|
|
@ -9,8 +9,11 @@
|
|||
const {Cu} = require("chrome");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
const {createNode} = require("devtools/client/animationinspector/utils");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/animationinspector.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
// List of playback rate presets displayed in the timeline toolbar.
|
||||
const PLAYBACK_RATES = [.1, .25, .5, 1, 2, 5, 10];
|
||||
|
||||
|
|
|
@ -7,8 +7,10 @@ requestLongerTimeout(2);
|
|||
|
||||
// Test that the panel shows no animation data for invalid or not animated nodes
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/animationinspector.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab(URL_ROOT + "doc_simple_animation.html");
|
||||
|
|
|
@ -9,8 +9,10 @@ requestLongerTimeout(2);
|
|||
// Test that when animations displayed in the timeline are running on the
|
||||
// compositor, they get a special icon and information in the tooltip.
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/animationinspector.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab(URL_ROOT + "doc_simple_animation.html");
|
||||
|
|
|
@ -11,8 +11,11 @@ Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
|||
var {loader} = Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/animationinspector.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
// How many times, maximum, can we loop before we find the optimal time
|
||||
// interval in the timeline graph.
|
||||
const OPTIMAL_TIME_INTERVAL_MAX_ITERS = 100;
|
||||
|
|
|
@ -17,6 +17,7 @@ const EventEmitter = require("devtools/shared/event-emitter");
|
|||
const { CallWatcherFront } = require("devtools/server/actors/call-watcher");
|
||||
const { CanvasFront } = require("devtools/server/actors/canvas");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const CANVAS_ACTOR_RECORDING_ATTEMPT = DevToolsUtils.testing ? 500 : 5000;
|
||||
|
||||
|
@ -175,8 +176,8 @@ var EventsHandler = {
|
|||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
var L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
var SHARED_L10N = new ViewHelpers.L10N(SHARED_STRINGS_URI);
|
||||
var L10N = new LocalizationHelper(STRINGS_URI);
|
||||
var SHARED_L10N = new LocalizationHelper(SHARED_STRINGS_URI);
|
||||
|
||||
/**
|
||||
* Convenient way of emitting events from the panel window.
|
||||
|
|
|
@ -105,11 +105,6 @@ Cu.import("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
|||
Cu.import("resource://devtools/client/shared/widgets/VariablesViewController.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
|
||||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
var L10N = new ViewHelpers.L10N(DBG_STRINGS_URI);
|
||||
|
||||
Cu.import("resource://devtools/client/shared/browser-loader.js");
|
||||
const { require } = BrowserLoader({
|
||||
baseURI: "resource://devtools/client/debugger/",
|
||||
|
@ -151,6 +146,7 @@ var Editor = require("devtools/client/sourceeditor/editor");
|
|||
var DebuggerEditor = require("devtools/client/sourceeditor/debugger");
|
||||
var {Tooltip} = require("devtools/client/shared/widgets/Tooltip");
|
||||
var FastListWidget = require("devtools/client/shared/widgets/FastListWidget");
|
||||
var {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
|
||||
XPCOMUtils.defineConstant(this, "EVENTS", EVENTS);
|
||||
|
||||
|
@ -174,6 +170,11 @@ Object.defineProperty(this, "NetworkHelper", {
|
|||
enumerable: true
|
||||
});
|
||||
|
||||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
var L10N = new LocalizationHelper(DBG_STRINGS_URI);
|
||||
|
||||
/**
|
||||
* Object defining the debugger controller components.
|
||||
*/
|
||||
|
|
|
@ -10,13 +10,14 @@ const {Cc, Ci, Cu} = require("chrome");
|
|||
const {InplaceEditor, editableItem} =
|
||||
require("devtools/client/shared/inplace-editor");
|
||||
const {ReflowFront} = require("devtools/server/actors/layout");
|
||||
const {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://gre/modules/Console.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/shared.properties";
|
||||
const SHARED_L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const SHARED_L10N = new LocalizationHelper(STRINGS_URI);
|
||||
const NUMERIC = /^-?[\d\.]+$/;
|
||||
const LONG_TEXT_ROTATE_LIMIT = 3;
|
||||
|
||||
|
|
|
@ -7,9 +7,10 @@ const {Cu} = require("chrome");
|
|||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
const {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
const {createNode} = require("devtools/client/animationinspector/utils");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/inspector.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
/**
|
||||
* UI component responsible for displaying a preview of a dom node.
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
const { Cu, Cc, Ci } = require("chrome");
|
||||
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const STRINGS_URI = "chrome://devtools/locale/memory.properties"
|
||||
const L10N = exports.L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = exports.L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
const { OS } = require("resource://gre/modules/osfile.jsm");
|
||||
const { assert } = require("devtools/shared/DevToolsUtils");
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
const { Ci, Cc } = require("chrome");
|
||||
const { defer, all } = require("promise");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
loader.lazyImporter(this, "ViewHelpers", "resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
loader.lazyRequireGetter(this, "NetworkHelper", "devtools/shared/webconsole/network-helper");
|
||||
|
@ -14,7 +15,7 @@ loader.lazyGetter(this, "appInfo", () => {
|
|||
});
|
||||
|
||||
loader.lazyGetter(this, "L10N", () => {
|
||||
return new ViewHelpers.L10N("chrome://devtools/locale/har.properties");
|
||||
return new LocalizationHelper("chrome://devtools/locale/har.properties");
|
||||
});
|
||||
|
||||
const HAR_VERSION = "1.1";
|
||||
|
|
|
@ -22,6 +22,7 @@ XPCOMUtils.defineLazyGetter(this, "NetworkHelper", function() {
|
|||
const {ToolSidebar} = require("devtools/client/framework/sidebar");
|
||||
const {Tooltip} = require("devtools/client/shared/widgets/Tooltip");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
|
||||
|
@ -29,7 +30,7 @@ Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
|||
* Localization convenience methods.
|
||||
*/
|
||||
const NET_STRINGS_URI = "chrome://devtools/locale/netmonitor.properties";
|
||||
var L10N = new ViewHelpers.L10N(NET_STRINGS_URI);
|
||||
var L10N = new LocalizationHelper(NET_STRINGS_URI);
|
||||
|
||||
// ms
|
||||
const WDA_DEFAULT_VERIFY_INTERVAL = 50;
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const { Cu } = require("chrome");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const STRINGS_URI = "chrome://devtools/locale/jit-optimizations.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
const { PluralForm } = require("resource://gre/modules/PluralForm.jsm");
|
||||
const { DOM: dom, PropTypes, createClass, createFactory } = require("devtools/client/shared/vendor/react");
|
||||
const {
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const { Cu } = require("chrome");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const STRINGS_URI = "chrome://devtools/locale/jit-optimizations.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
const { assert } = require("devtools/shared/DevToolsUtils");
|
||||
const { DOM: dom, createClass, createFactory, PropTypes } = require("devtools/client/shared/vendor/react");
|
||||
const Tree = createFactory(require("../../shared/components/tree"));
|
||||
|
|
|
@ -3,15 +3,16 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { MultiLocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const { ViewHelpers } = require("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
|
||||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
const L10N = new ViewHelpers.MultiL10N([
|
||||
const L10N = new MultiLocalizationHelper(
|
||||
"chrome://devtools/locale/markers.properties",
|
||||
"chrome://devtools/locale/performance.properties"
|
||||
]);
|
||||
);
|
||||
|
||||
/**
|
||||
* A list of preferences for this tool. The values automatically update
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
*/
|
||||
|
||||
const { Cu, Cc, Ci } = require("chrome");
|
||||
const { ViewHelpers } = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const ITCHPAD_STRINGS_URI = "chrome://devtools/locale/projecteditor.properties";
|
||||
const L10N = new ViewHelpers.L10N(ITCHPAD_STRINGS_URI).stringBundle;
|
||||
const L10N = new LocalizationHelper(ITCHPAD_STRINGS_URI).stringBundle;
|
||||
|
||||
function getLocalizedString (name) {
|
||||
try {
|
||||
|
|
|
@ -4,13 +4,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const STRINGS_URI = "chrome://devtools/locale/responsive.properties";
|
||||
|
||||
const {
|
||||
ViewHelpers
|
||||
} = require("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
module.exports = {
|
||||
getStr: (...args) => L10N.getStr(...args),
|
||||
|
|
|
@ -17,6 +17,8 @@ var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
|||
var Services = require("Services");
|
||||
var EventEmitter = require("devtools/shared/event-emitter");
|
||||
var {ViewHelpers} = require("devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
var { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
loader.lazyImporter(this, "SystemAppProxy",
|
||||
"resource://gre/modules/SystemAppProxy.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerClient",
|
||||
|
@ -37,7 +39,7 @@ const ROUND_RATIO = 10;
|
|||
|
||||
const INPUT_PARSER = /(\d+)[^\d]+(\d+)/;
|
||||
|
||||
const SHARED_L10N = new ViewHelpers.L10N("chrome://devtools/locale/shared.properties");
|
||||
const SHARED_L10N = new LocalizationHelper("chrome://devtools/locale/shared.properties");
|
||||
|
||||
function debug(msg) {
|
||||
// dump(`RDM UI: ${msg}\n`);
|
||||
|
|
|
@ -17,6 +17,7 @@ const Services = require("Services");
|
|||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {Tooltip} = require("devtools/client/shared/widgets/Tooltip");
|
||||
const Editor = require("devtools/client/sourceeditor/editor");
|
||||
const {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
|
||||
// The panel's window global is an EventEmitter firing the following events:
|
||||
const EVENTS = {
|
||||
|
@ -618,7 +619,7 @@ var ShadersEditorsView = {
|
|||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
var L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
var L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
/**
|
||||
* Convenient way of emitting events from the panel window.
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
|
||||
const { DOM: dom, createClass, PropTypes } = require("devtools/client/shared/vendor/react");
|
||||
const { getSourceNames, parseURL, isScratchpadScheme } = require("devtools/client/shared/source-utils");
|
||||
const { L10N } = require("resource://devtools/client/shared/widgets/ViewHelpers.jsm").ViewHelpers;
|
||||
const l10n = new L10N("chrome://devtools/locale/components.properties");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const l10n = new LocalizationHelper("chrome://devtools/locale/components.properties");
|
||||
|
||||
module.exports = createClass({
|
||||
propTypes: {
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
"use strict";
|
||||
|
||||
const { URL } = require("sdk/url");
|
||||
const { L10N } = require("resource://devtools/client/shared/widgets/ViewHelpers.jsm").ViewHelpers;
|
||||
const l10n = new L10N("chrome://devtools/locale/components.properties");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const l10n = new LocalizationHelper("chrome://devtools/locale/components.properties");
|
||||
const UNKNOWN_SOURCE_STRING = l10n.getStr("frame.unknownSource");
|
||||
|
||||
// Character codes used in various parsing helper functions.
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
const TEST_URI = "chrome://devtools/content/shared/widgets/filter-frame.xhtml";
|
||||
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
|
||||
|
||||
const { ViewHelpers } = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const STRINGS_URI = "chrome://devtools/locale/filterwidget.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab("about:blank");
|
||||
|
|
|
@ -9,9 +9,9 @@ const TEST_URI = "chrome://devtools/content/shared/widgets/filter-frame.xhtml";
|
|||
|
||||
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
|
||||
|
||||
const { ViewHelpers } = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const STRINGS_URI = "chrome://devtools/locale/filterwidget.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab("about:blank");
|
||||
|
|
|
@ -9,9 +9,9 @@ const TEST_URI = "chrome://devtools/content/shared/widgets/filter-frame.xhtml";
|
|||
|
||||
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
|
||||
|
||||
const { ViewHelpers } = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const STRINGS_URI = "chrome://devtools/locale/filterwidget.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab("about:blank");
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
// Tests that text metrics in the flame graph widget work properly.
|
||||
|
||||
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
var {ViewHelpers} = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
|
||||
var {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
var {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
|
||||
var {FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
|
||||
var {FLAME_GRAPH_BLOCK_TEXT_FONT_FAMILY} = require("devtools/client/shared/widgets/FlameGraph");
|
||||
|
||||
var L10N = new ViewHelpers.L10N();
|
||||
var L10N = new LocalizationHelper();
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab("about:blank");
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Tests that ViewHelpers.Prefs work properly.
|
||||
// Tests that the localization utils work properly.
|
||||
|
||||
var {ViewHelpers} = Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm", {});
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
function test() {
|
||||
let l10n = new ViewHelpers.L10N();
|
||||
let l10n = new LocalizationHelper();
|
||||
|
||||
is(l10n.numberWithDecimals(1234.56789, 2), "1,234.57",
|
||||
"The first number was properly localized.");
|
||||
|
|
|
@ -22,12 +22,15 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["Chart"];
|
||||
|
||||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
var L10N = new ViewHelpers.L10N(NET_STRINGS_URI);
|
||||
var L10N = new LocalizationHelper(NET_STRINGS_URI);
|
||||
|
||||
/**
|
||||
* A factory for creating charts.
|
||||
|
|
|
@ -14,8 +14,11 @@ const { Cu, Cc, Ci } = require("chrome");
|
|||
const { ViewHelpers } =
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm",
|
||||
{});
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const STRINGS_URI = "chrome://devtools/locale/filterwidget.properties";
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
const {cssTokenizer} = require("devtools/client/shared/css-parsing-utils");
|
||||
|
||||
loader.lazyGetter(this, "asyncStorage",
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
const { Task } = require("resource://gre/modules/Task.jsm");
|
||||
const { ViewHelpers } = require("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
const { setNamedTimeout, clearNamedTimeout } = require("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
loader.lazyRequireGetter(this, "promise");
|
||||
loader.lazyRequireGetter(this, "EventEmitter",
|
||||
|
@ -31,7 +32,7 @@ loader.lazyRequireGetter(this, "GraphAreaDragger",
|
|||
const HTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
const GRAPH_SRC = "chrome://devtools/content/shared/widgets/graphs-frame.xhtml";
|
||||
|
||||
const L10N = new ViewHelpers.L10N();
|
||||
const L10N = new LocalizationHelper();
|
||||
|
||||
const GRAPH_RESIZE_EVENTS_DRAIN = 100; // ms
|
||||
|
||||
|
|
|
@ -5,9 +5,10 @@ const { Cc, Ci, Cu, Cr } = require("chrome");
|
|||
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
const { ViewHelpers, Heritage } = require("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
const { AbstractCanvasGraph, CanvasGraphUtils } = require("devtools/client/shared/widgets/Graphs");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const HTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
const L10N = new ViewHelpers.L10N("chrome://devtools/locale/graphs.properties");
|
||||
const L10N = new LocalizationHelper("chrome://devtools/locale/graphs.properties");
|
||||
|
||||
// Line graph constants.
|
||||
|
||||
|
|
|
@ -13,12 +13,15 @@ const SHARED_STRINGS_URI = "chrome://devtools/locale/shared.properties";
|
|||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["SideMenuWidget"];
|
||||
|
||||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
var L10N = new ViewHelpers.L10N(SHARED_STRINGS_URI);
|
||||
var L10N = new LocalizationHelper(SHARED_STRINGS_URI);
|
||||
|
||||
/**
|
||||
* A simple side menu, with the ability of grouping menu items.
|
||||
|
|
|
@ -13,6 +13,7 @@ Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
|||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var Services = require("Services");
|
||||
var promise = require("promise");
|
||||
var {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
|
||||
Object.defineProperty(this, "WebConsoleUtils", {
|
||||
get: function() {
|
||||
|
@ -33,10 +34,12 @@ const MAX_LONG_STRING_LENGTH = 200000;
|
|||
const MAX_PROPERTY_ITEMS = 2000;
|
||||
const DBG_STRINGS_URI = "chrome://devtools/locale/debugger.properties";
|
||||
|
||||
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["VariablesViewController", "StackFrameUtils"];
|
||||
|
||||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
var L10N = new LocalizationHelper(DBG_STRINGS_URI);
|
||||
|
||||
/**
|
||||
* Controller for a VariablesView that handles interfacing with the debugger
|
||||
|
@ -195,7 +198,7 @@ VariablesViewController.prototype = {
|
|||
// Query the name of the first and last items for this slice
|
||||
let deferred = promise.defer();
|
||||
aIterator.names([start, start + count - 1], ({ names }) => {
|
||||
let label = "[" + names[0] + ELLIPSIS + names[1] + "]";
|
||||
let label = "[" + names[0] + L10N.ellipsis + names[1] + "]";
|
||||
let item = aTarget.addItem(label);
|
||||
item.showArrow();
|
||||
this.addExpander(item, sliceGrip);
|
||||
|
@ -791,8 +794,3 @@ var StackFrameUtils = this.StackFrameUtils = {
|
|||
return label;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Localization convenience methods.
|
||||
*/
|
||||
var L10N = new ViewHelpers.L10N(DBG_STRINGS_URI);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
const {Cu} = require("chrome");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
|
||||
loader.lazyRequireGetter(this, "TreeWidget",
|
||||
"devtools/client/shared/widgets/TreeWidget", true);
|
||||
|
@ -21,7 +22,7 @@ loader.lazyImporter(this, "VariablesView",
|
|||
* Localization convenience methods.
|
||||
*/
|
||||
const STORAGE_STRINGS = "chrome://devtools/locale/storage.properties";
|
||||
const L10N = new ViewHelpers.L10N(STORAGE_STRINGS);
|
||||
const L10N = new LocalizationHelper(STORAGE_STRINGS);
|
||||
|
||||
const GENERIC_VARIABLES_VIEW_SETTINGS = {
|
||||
lazyEmpty: true,
|
||||
|
|
|
@ -16,11 +16,13 @@ var { EventTarget } = require("sdk/event/target");
|
|||
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
const { Class } = require("sdk/core/heritage");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const STRINGS_URI = "chrome://devtools/locale/webaudioeditor.properties"
|
||||
const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const Services = require("Services");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/webaudioeditor.properties"
|
||||
const L10N = new LocalizationHelper(STRINGS_URI);
|
||||
|
||||
loader.lazyRequireGetter(this, "LineGraphWidget",
|
||||
"devtools/client/shared/widgets/LineGraphWidget");
|
||||
|
|
Загрузка…
Ссылка в новой задаче