Bug 1510797 - Migrate about:webrtc to Fluent; r=ng,flod

Differential Revision: https://phabricator.services.mozilla.com/D102931
This commit is contained in:
Dan Minor 2021-01-27 12:11:47 +00:00
parent 36456c9b0e
commit fd50ec0311
11 changed files with 861 additions and 391 deletions

View File

@ -24,7 +24,6 @@ def test(mod, path, entity=None):
"chrome/global/commonDialogs.properties",
"chrome/global/intl.properties",
"chrome/global/intl.css",
"chrome/global/aboutWebrtc.properties",
):
return "error"
if re.match(r"crashreporter/[^/]*.ftl", path):
@ -48,6 +47,9 @@ def test(mod, path, entity=None):
if re.match(r"toolkit/about/[^/]*Support.ftl", path):
# error on toolkit/about/*Support.ftl
return "error"
if re.match(r"toolkit/about/[^/]*Webrtc.ftl", path):
# error on toolkit/about/*Webrtc.ftl
return "error"
return "ignore"
if mod == "dom":

View File

@ -21,8 +21,6 @@ relativesrcdir toolkit/locales:
locale/@AB_CD@/browser/overrides/commonDialogs.properties (%chrome/global/commonDialogs.properties)
locale/@AB_CD@/browser/overrides/intl.properties (%chrome/global/intl.properties)
locale/@AB_CD@/browser/overrides/intl.css (%chrome/global/intl.css)
#about:webrtc
locale/@AB_CD@/browser/overrides/global/aboutWebrtc.properties (%chrome/global/aboutWebrtc.properties)
# overrides for dom l10n, also for en-US
# keep this file list in sync with filter.py
@ -57,6 +55,8 @@ relativesrcdir toolkit/locales:
toolkit/about (%toolkit/about/*Rights.ftl)
#about:compat
toolkit/about (%toolkit/about/*Compat.ftl)
#about:webrtc
toolkit/about (%toolkit/about/*Webrtc.ftl)
#endif
# Do not add files below the endif. Reviewers, expand more context above
# for comments.

View File

@ -232,6 +232,9 @@ exclude-multi-locale = [
reference = "toolkit/locales/en-US/chrome/global/aboutWebrtc.properties"
l10n = "{l}toolkit/chrome/global/aboutWebrtc.properties"
[[paths]]
reference = "toolkit/locales/en-US/toolkit/about/*Webrtc.ftl"
l10n = "{l}toolkit/toolkit/about/*Webrtc.ftl"
[[filters]]
path = [

View File

@ -24,7 +24,6 @@ def test(mod, path, entity=None):
"chrome/global/commonDialogs.properties",
"chrome/global/intl.properties",
"chrome/global/intl.css",
"chrome/global/aboutWebrtc.properties",
):
return "error"
if re.match(r"crashreporter/[^/]*.ftl", path):
@ -49,6 +48,9 @@ def test(mod, path, entity=None):
if re.match(r"toolkit/about/[^/]*Support.ftl", path):
# error on toolkit/about/*Support.ftl
return "error"
if re.match(r"toolkit/about/[^/]*Webrtc.ftl", path):
# error on toolkit/about/*Webrtc.ftl
return "error"
return "ignore"
if mod == "dom":

View File

@ -0,0 +1,254 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate import CONCAT, COPY, REPLACE
from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE, transforms_from
def migrate(ctx):
"""Bug 1510797 - Migrate about:webrtc to Fluent, part {index}"""
target = "toolkit/toolkit/about/aboutWebrtc.ftl"
reference = "toolkit/toolkit/about/aboutWebrtc.ftl"
ctx.add_transforms(
target,
reference,
transforms_from(
"""
about-webrtc-document-title = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "document_title") }
about-webrtc-save-page-dialog-title = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "save_page_dialog_title") }
about-webrtc-aec-logging-msg-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "aec_logging_msg_label") }
about-webrtc-aec-logging-off-state-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "aec_logging_off_state_label") }
about-webrtc-aec-logging-on-state-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "aec_logging_on_state_label") }
about-webrtc-aec-logging-on-state-msg = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "aec_logging_on_state_msg") }
about-webrtc-peerconnection-id-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "peer_connection_id_label") }:
about-webrtc-sdp-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "sdp_heading") }
about-webrtc-local-sdp-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "local_sdp_heading") }
about-webrtc-local-sdp-heading-offer = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "local_sdp_heading") } ({ COPY("toolkit/chrome/global/aboutWebrtc.properties", "offer") })
about-webrtc-local-sdp-heading-answer = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "local_sdp_heading") } ({ COPY("toolkit/chrome/global/aboutWebrtc.properties", "answer") })
about-webrtc-remote-sdp-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "remote_sdp_heading") }
about-webrtc-remote-sdp-heading-offer = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "remote_sdp_heading") } ({ COPY("toolkit/chrome/global/aboutWebrtc.properties", "offer") })
about-webrtc-remote-sdp-heading-answer = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "remote_sdp_heading") } ({ COPY("toolkit/chrome/global/aboutWebrtc.properties", "answer") })
about-webrtc-sdp-history-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "sdp_history_heading") }
about-webrtc-sdp-parsing-errors-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "sdp_parsing_errors_heading") }
about-webrtc-rtp-stats-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "rtp_stats_heading") }
about-webrtc-ice-state = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "ice_state") }
about-webrtc-ice-stats-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "ice_stats_heading") }
about-webrtc-ice-restart-count-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "ice_restart_count_label") }:
about-webrtc-ice-rollback-count-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "ice_rollback_count_label") }:
about-webrtc-ice-pair-bytes-sent = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "ice_pair_bytes_sent") }:
about-webrtc-ice-pair-bytes-received = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "ice_pair_bytes_received") }:
about-webrtc-ice-component-id = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "ice_component_id") }
about-webrtc-type-local = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "typeLocal") }
about-webrtc-type-remote = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "typeRemote") }
about-webrtc-nominated = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "nominated") }
about-webrtc-selected = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "selected") }
about-webrtc-save-page-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "save_page_label") }
about-webrtc-debug-mode-msg-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "debug_mode_msg_label") }
about-webrtc-debug-mode-off-state-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "debug_mode_off_state_label") }
about-webrtc-debug-mode-on-state-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "debug_mode_on_state_label") }
about-webrtc-stats-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "stats_heading") }
about-webrtc-stats-clear = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "stats_clear") }
about-webrtc-log-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "log_heading") }
about-webrtc-log-clear = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "log_clear") }
about-webrtc-connection-open = [ { $browser-id } | { $id } ] { $url } { $now }
about-webrtc-connection-closed = [ { $browser-id } | { $id } ] { $url } ({ COPY("toolkit/chrome/global/aboutWebrtc.properties", "connection_closed") }) { $now }
about-webrtc-local-candidate = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "local_candidate") }
about-webrtc-remote-candidate = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "remote_candidate") }
about-webrtc-raw-candidates-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "raw_candidates_heading") }
about-webrtc-raw-local-candidate = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "raw_local_candidate") }
about-webrtc-raw-remote-candidate = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "raw_remote_candidate") }
about-webrtc-raw-cand-show-msg = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "raw_cand_show_msg") }
.title = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "fold_show_hint") }
about-webrtc-raw-cand-hide-msg = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "raw_cand_hide_msg") }
.title = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "fold_hide_hint") }
about-webrtc-priority = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "priority") }
about-webrtc-log-show-msg = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "log_show_msg") }
.title = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "fold_show_hint") }
about-webrtc-log-hide-msg = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "log_hide_msg") }
.title = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "fold_hide_hint") }
about-webrtc-fold-show-msg = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "fold_show_msg") }
.title = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "fold_show_hint") }
about-webrtc-fold-hide-msg = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "fold_hide_msg") }
.title = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "fold_hide_hint") }
about-webrtc-decoder-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "decoder_label") }
about-webrtc-encoder-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "encoder_label") }
about-webrtc-jitter-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "jitter_label") } { $jitter }
about-webrtc-show-tab-label = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "show_tab_label") }
about-webrtc-width-px = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "width_px") }
about-webrtc-height-px = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "height_px") }
about-webrtc-consecutive-frames = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "consecutive_frames") }
about-webrtc-time-elapsed = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "time_elapsed") }
about-webrtc-estimated-framerate = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "estimated_framerate") }
about-webrtc-rotation-degrees = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "rotation_degrees") }
about-webrtc-first-frame-timestamp = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "first_frame_timestamp") }
about-webrtc-last-frame-timestamp = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "last_frame_timestamp") }
about-webrtc-local-receive-ssrc = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "local_receive_ssrc") }
about-webrtc-remote-send-ssrc = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "remote_send_ssrc") }
about-webrtc-configuration-element-provided = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "configuration_element_provided") }
about-webrtc-configuration-element-not-provided = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "configuration_element_not_provided") }
about-webrtc-custom-webrtc-configuration-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "custom_webrtc_configuration_heading") }
about-webrtc-bandwidth-stats-heading = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "bandwidth_stats_heading") }
about-webrtc-track-identifier = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "track_identifier") }
about-webrtc-send-bandwidth-bytes-sec = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "send_bandwidth_bytes_sec") }
about-webrtc-receive-bandwidth-bytes-sec = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "receive_bandwidth_bytes_sec") }
about-webrtc-max-padding-bytes-sec = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "max_padding_bytes_sec") }
about-webrtc-pacer-delay-ms = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "pacer_delay_ms") }
about-webrtc-round-trip-time-ms = { COPY("toolkit/chrome/global/aboutWebrtc.properties", "round_trip_time_ms") }
"""
),
)
ctx.add_transforms(
target,
reference,
[
FTL.Message(
id=FTL.Identifier("about-webrtc-save-page-msg"),
value=REPLACE(
"toolkit/chrome/global/aboutWebrtc.properties",
"save_page_msg",
{
"%1$S": VARIABLE_REFERENCE("path"),
},
normalize_printf=True,
),
),
FTL.Message(
id=FTL.Identifier("about-webrtc-debug-mode-off-state-msg"),
value=REPLACE(
"toolkit/chrome/global/aboutWebrtc.properties",
"debug_mode_off_state_msg",
{
"%1$S": VARIABLE_REFERENCE("path"),
},
normalize_printf=True,
),
),
FTL.Message(
id=FTL.Identifier("about-webrtc-debug-mode-on-state-msg"),
value=REPLACE(
"toolkit/chrome/global/aboutWebrtc.properties",
"debug_mode_on_state_msg",
{
"%1$S": VARIABLE_REFERENCE("path"),
},
normalize_printf=True,
),
),
FTL.Message(
id=FTL.Identifier("about-webrtc-aec-logging-off-state-msg"),
value=REPLACE(
"toolkit/chrome/global/aboutWebrtc.properties",
"aec_logging_off_state_msg",
{
"%1$S": VARIABLE_REFERENCE("path"),
},
normalize_printf=True,
),
),
FTL.Message(
id=FTL.Identifier("about-webrtc-trickle-caption-msg"),
value=REPLACE(
"toolkit/chrome/global/aboutWebrtc.properties",
"trickle_caption_msg2",
{
"%1$S": COPY(
"toolkit/chrome/global/aboutWebrtc.properties",
"trickle_highlight_color_name2",
)
},
normalize_printf=True,
),
),
FTL.Message(
id=FTL.Identifier("about-webrtc-sdp-set-at-timestamp-local"),
value=REPLACE(
"toolkit/chrome/global/aboutWebrtc.properties",
"sdp_set_at_timestamp",
{
"%1$S": COPY(
"toolkit/chrome/global/aboutWebrtc.properties",
"local_sdp_heading",
),
"%2$S": FTL.FunctionReference(
id=FTL.Identifier("NUMBER"),
arguments=FTL.CallArguments(
positional=[
FTL.VariableReference(
id=FTL.Identifier("timestamp")
)
],
named=[
FTL.NamedArgument(
name=FTL.Identifier("useGrouping"),
value=FTL.StringLiteral("false"),
)
],
),
),
},
normalize_printf=True,
),
),
FTL.Message(
id=FTL.Identifier("about-webrtc-sdp-set-at-timestamp-remote"),
value=REPLACE(
"toolkit/chrome/global/aboutWebrtc.properties",
"sdp_set_at_timestamp",
{
"%1$S": COPY(
"toolkit/chrome/global/aboutWebrtc.properties",
"remote_sdp_heading",
),
"%2$S": FTL.FunctionReference(
id=FTL.Identifier("NUMBER"),
arguments=FTL.CallArguments(
positional=[
FTL.VariableReference(
id=FTL.Identifier("timestamp")
)
],
named=[
FTL.NamedArgument(
name=FTL.Identifier("useGrouping"),
value=FTL.StringLiteral("false"),
)
],
),
),
},
normalize_printf=True,
),
),
FTL.Message(
id=FTL.Identifier("about-webrtc-sdp-set-timestamp"),
value=REPLACE(
"toolkit/chrome/global/aboutWebrtc.properties",
"sdp_set_timestamp",
{
"%1$S": FTL.FunctionReference(
id=FTL.Identifier("NUMBER"),
arguments=FTL.CallArguments(
positional=[
FTL.VariableReference(
id=FTL.Identifier("timestamp")
)
],
named=[
FTL.NamedArgument(
name=FTL.Identifier("useGrouping"),
value=FTL.StringLiteral("false"),
)
],
),
),
"%2$S": VARIABLE_REFERENCE("relative-timestamp"),
},
normalize_printf=True,
),
),
],
)

View File

@ -110,6 +110,14 @@ table {
font-weight: bold;
}
.info-body {
padding-left: 0.5em;
}
.stat-label {
padding-left: 0.5em;
}
.section-ctrl {
margin: 1em 1.5em;
}

View File

@ -8,11 +8,12 @@
<head>
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'" />
<meta charset="utf-8" />
<title>about:webrtc</title>
<title data-l10n-id="about-webrtc-document-title"></title>
<link rel="stylesheet" type="text/css" media="all"
href="chrome://global/content/aboutwebrtc/aboutWebrtc.css"/>
<script src="chrome://global/content/aboutwebrtc/aboutWebrtc.js"
defer="defer"></script>
<link rel="localization" href="toolkit/about/aboutWebrtc.ftl"/>
</head>
<body id="body">
<div id="controls" class="no-print"></div>

View File

@ -19,12 +19,7 @@ XPCOMUtils.defineLazyServiceGetter(
"@mozilla.org/filepicker;1",
"nsIFilePicker"
);
XPCOMUtils.defineLazyGetter(this, "strings", () =>
Services.strings.createBundle("chrome://global/locale/aboutWebrtc.properties")
);
const string = strings.GetStringFromName;
const format = strings.formatStringFromName;
const WGI = WebrtcGlobalInformation;
const LOGFILE_NAME_DEFAULT = "aboutWebrtc.html";
@ -37,8 +32,13 @@ async function getStats() {
const getLog = () => new Promise(r => WGI.getLogging("", r));
const renderElement = (name, options) =>
Object.assign(document.createElement(name), options);
const renderElement = (name, options, l10n_id, l10n_args) => {
let elem = Object.assign(document.createElement(name), options);
if (l10n_id) {
document.l10n.setAttributes(elem, l10n_id, l10n_args);
}
return elem;
};
const renderText = (name, textContent, options) =>
renderElement(name, Object.assign({ textContent }, options));
@ -54,24 +54,40 @@ const renderElements = (name, options, list) => {
class Control {
label = null;
message = null;
messageArgs = null;
messageHeader = null;
render() {
this.ctrl = renderElement("button", { onclick: () => this.onClick() });
this.ctrl = renderElement(
"button",
{ onclick: () => this.onClick() },
this.label
);
this.msg = renderElement("p");
this.update();
return [this.ctrl, this.msg];
}
update() {
this.ctrl.textContent = this.label;
document.l10n.setAttributes(this.ctrl, this.label);
this.msg.textContent = "";
if (this.message) {
this.msg.append(
renderText("span", `${this.messageHeader}: `, {
className: "info-label",
}),
this.message
renderElement(
"span",
{
className: "info-label",
},
this.messageHeader
),
renderElement(
"span",
{
className: "info-body",
},
this.message,
this.messageArgs
)
);
}
}
@ -80,17 +96,16 @@ class Control {
class SavePage extends Control {
constructor() {
super();
this.messageHeader = string("save_page_label");
this.label = string("save_page_label");
this.messageHeader = "about-webrtc-save-page-label";
this.label = "about-webrtc-save-page-label";
}
async onClick() {
FoldEffect.expandAll();
FilePicker.init(
window,
string("save_page_dialog_title"),
FilePicker.modeSave
);
let [dialogTitle] = await document.l10n.formatValues([
{ id: "about-webrtc-save-page-dialog-title" },
]);
FilePicker.init(window, dialogTitle, FilePicker.modeSave);
FilePicker.defaultString = LOGFILE_NAME_DEFAULT;
const rv = await new Promise(r => FilePicker.open(r));
if (rv != FilePicker.returnOK && rv != FilePicker.returnReplace) {
@ -113,7 +128,8 @@ class SavePage extends Control {
node.style.removeProperty("display");
}
}
this.message = format("save_page_msg", [FilePicker.file.path]);
this.message = "about-webrtc-save-page-msg";
this.messageArgs = { path: FilePicker.file.path };
this.update();
}
}
@ -121,21 +137,25 @@ class SavePage extends Control {
class DebugMode extends Control {
constructor() {
super();
this.messageHeader = string("debug_mode_msg_label");
this.messageHeader = "about-webrtc-debug-mode-msg-label";
if (WGI.debugLevel > 0) {
this.setState(true);
} else {
this.label = string("debug_mode_off_state_label");
this.label = "about-webrtc-debug-mode-off-state-label";
}
}
setState(state) {
const stateString = state ? "on" : "off";
this.label = string(`debug_mode_${stateString}_state_label`);
this.label = state
? "about-webrtc-debug-mode-on-state-label"
: "about-webrtc-debug-mode-off-state-label";
try {
const file = Services.prefs.getCharPref("media.webrtc.debug.log_file");
this.message = format(`debug_mode_${stateString}_state_msg`, [file]);
this.message = state
? "about-webrtc-debug-mode-on-state-msg"
: "about-webrtc-debug-mode-off-state-msg";
this.messageArgs = { path: file };
} catch (e) {
this.message = null;
}
@ -151,24 +171,27 @@ class DebugMode extends Control {
class AecLogging extends Control {
constructor() {
super();
this.messageHeader = string("aec_logging_msg_label");
this.messageHeader = "about-webrtc-aec-logging-msg-label";
if (WGI.aecDebug) {
this.setState(true);
} else {
this.label = string("aec_logging_off_state_label");
this.label = "about-webrtc-aec-logging-off-state-label";
this.message = null;
}
}
setState(state) {
this.label = string(`aec_logging_${state ? "on" : "off"}_state_label`);
this.label = state
? "about-webrtc-aec-logging-on-state-label"
: "about-webrtc-aec-logging-off-state-label";
try {
if (!state) {
const file = WGI.aecDebugLogDir;
this.message = format("aec_logging_off_state_msg", [file]);
this.message = "about-webrtc-aec-logging-off-state-msg";
this.messageArgs = { path: file };
} else {
this.message = string("aec_logging_on_state_msg");
this.message = "about-webrtc-aec-logging-on-state-msg";
}
} catch (e) {
this.message = null;
@ -184,7 +207,7 @@ class AecLogging extends Control {
class ShowTab extends Control {
constructor(browserId) {
super();
this.label = string("show_tab_label");
this.label = "about-webrtc-show-tab-label";
this.message = null;
this.browserId = browserId;
}
@ -207,8 +230,6 @@ class ShowTab extends Control {
const haveReports = getStats();
const haveLog = getLog();
await new Promise(r => (window.onload = r));
document.title = string("document_title");
{
const ctrl = renderElement("div", { className: "control" });
const msg = renderElement("div", { className: "message" });
@ -240,36 +261,43 @@ class ShowTab extends Control {
function refresh() {
const pcDiv = renderElements("div", { className: "stats" }, [
renderElements("span", { className: "section-heading" }, [
renderText("h3", string("stats_heading")),
renderText("button", string("stats_clear"), {
className: "no-print",
onclick: async () => {
WGI.clearAllStats();
reports = await getStats();
refresh();
renderElement("h3", {}, "about-webrtc-stats-heading"),
renderElement(
"button",
{
className: "no-print",
onclick: async () => {
WGI.clearAllStats();
reports = await getStats();
refresh();
},
},
}),
"about-webrtc-stats-clear"
),
]),
...reports.map(renderPeerConnection),
]);
const logDiv = renderElements("div", { className: "log" }, [
renderElements("span", { className: "section-heading" }, [
renderText("h3", string("log_heading")),
renderElement("button", {
textContent: string("log_clear"),
className: "no-print",
onclick: async () => {
WGI.clearLogging();
log = await getLog();
refresh();
renderElement("h3", {}, "about-webrtc-log-heading"),
renderElement(
"button",
{
className: "no-print",
onclick: async () => {
WGI.clearLogging();
log = await getLog();
refresh();
},
},
}),
"about-webrtc-log-clear"
),
]),
]);
if (log.length) {
const div = renderFoldableSection(logDiv, {
showMsg: string("log_show_msg"),
hideMsg: string("log_hide_msg"),
showMsg: "about-webrtc-log-show-msg",
hideMsg: "about-webrtc-log-hide-msg",
});
div.append(...log.map(line => renderText("p", line)));
logDiv.append(div);
@ -313,11 +341,22 @@ function renderPeerConnection(report) {
{
const id = pcid.match(/id=(\S+)/)[1];
const url = pcid.match(/url=([^)]+)/)[1];
const closedStr = closed ? `(${string("connection_closed")})` : "";
const now = new Date(timestamp).toString();
const now = new Date(timestamp);
pcDiv.append(
renderText("h3", `[ ${browserId} | ${id} ] ${url} ${closedStr} ${now}`)
closed
? renderElement("h3", {}, "about-webrtc-connection-closed", {
"browser-id": browserId,
id,
url,
now,
})
: renderElement("h3", {}, "about-webrtc-connection-open", {
"browser-id": browserId,
id,
url,
now,
})
);
pcDiv.append(new ShowTab(browserId).render()[0]);
}
@ -325,9 +364,13 @@ function renderPeerConnection(report) {
const section = renderFoldableSection(pcDiv);
section.append(
renderElements("div", {}, [
renderText("span", `${string("peer_connection_id_label")}: `, {
className: "info-label",
}),
renderElement(
"span",
{
className: "info-label",
},
"about-webrtc-peerconnection-id-label"
),
renderText("span", pcid, { className: "info-body" }),
]),
renderConfiguration(configuration),
@ -346,33 +389,37 @@ function renderSDPStats({ offerer, localSdp, remoteSdp, sdpHistory }) {
const trimNewlines = sdp => sdp.replaceAll("\r\n", "\n");
const statsDiv = renderElements("div", {}, [
renderText("h4", string("sdp_heading")),
renderText(
renderElement("h4", {}, "about-webrtc-sdp-heading"),
renderElement(
"h5",
`${string("local_sdp_heading")} (${string(offerer ? "offer" : "answer")})`
{},
offerer
? "about-webrtc-local-sdp-heading-offer"
: "about-webrtc-local-sdp-heading-answer"
),
renderText("pre", trimNewlines(localSdp)),
renderText(
renderElement(
"h5",
`${string("remote_sdp_heading")} (${string(
offerer ? "answer" : "offer"
)})`
{},
offerer
? "about-webrtc-remote-sdp-heading-answer"
: "about-webrtc-remote-sdp-heading-offer"
),
renderText("pre", trimNewlines(remoteSdp)),
renderText("h4", string("sdp_history_heading")),
renderElement("h4", {}, "about-webrtc-sdp-history-heading"),
]);
// All SDP in sequential order. Add onclick handler to scroll the associated
// SDP into view below.
for (const { isLocal, timestamp } of sdpHistory) {
const histDiv = renderElement("div", {});
const text = renderText(
const text = renderElement(
"h5",
format("sdp_set_at_timestamp", [
string(`${isLocal ? "local" : "remote"}_sdp_heading`),
timestamp,
]),
{ className: "sdp-history-link" }
{ className: "sdp-history-link" },
isLocal
? "about-webrtc-sdp-set-at-timestamp-local"
: "about-webrtc-sdp-set-at-timestamp-remote",
{ timestamp }
);
text.onclick = () => {
const elem = document.getElementById("sdp-history: " + timestamp);
@ -387,10 +434,10 @@ function renderSDPStats({ offerer, localSdp, remoteSdp, sdpHistory }) {
// Render the SDP into separate columns for local and remote.
const section = renderElement("div", { className: "sdp-history" });
const localDiv = renderElements("div", {}, [
renderText("h4", `${string("local_sdp_heading")}`),
renderElement("h4", {}, "about-webrtc-local-sdp-heading"),
]);
const remoteDiv = renderElements("div", {}, [
renderText("h4", `${string("remote_sdp_heading")}`),
renderElement("h4", {}, "about-webrtc-remote-sdp-heading"),
]);
let first = NaN;
@ -400,14 +447,17 @@ function renderSDPStats({ offerer, localSdp, remoteSdp, sdpHistory }) {
}
const histDiv = isLocal ? localDiv : remoteDiv;
histDiv.append(
renderText(
renderElement(
"h5",
format("sdp_set_timestamp", [timestamp, timestamp - first]),
{ id: "sdp-history: " + timestamp }
{ id: "sdp-history: " + timestamp },
"about-webrtc-sdp-set-timestamp",
{ timestamp, "relative-timestamp": timestamp - first }
)
);
if (errors.length) {
histDiv.append(renderElement("h5", string("sdp_parsing_errors_heading")));
histDiv.append(
renderElement("h5", {}, "about-webrtc-sdp-parsing-errors-heading")
);
}
for (const { lineNumber, error } of errors) {
histDiv.append(renderElement("br"), `${lineNumber}: ${error}`);
@ -426,13 +476,13 @@ function renderBandwidthStats(report) {
const table = renderSimpleTable(
"",
[
"track_identifier",
"send_bandwidth_bytes_sec",
"receive_bandwidth_bytes_sec",
"max_padding_bytes_sec",
"pacer_delay_ms",
"round_trip_time_ms",
].map(columnName => string(columnName)),
"about-webrtc-track-identifier",
"about-webrtc-send-bandwidth-bytes-sec",
"about-webrtc-receive-bandwidth-bytes-sec",
"about-webrtc-max-padding-bytes-sec",
"about-webrtc-pacer-delay-ms",
"about-webrtc-round-trip-time-ms",
],
report.bandwidthEstimations.map(stat => [
stat.trackIdentifier,
stat.sendBandwidthBps,
@ -442,7 +492,10 @@ function renderBandwidthStats(report) {
stat.rttMs,
])
);
statsDiv.append(renderText("h4", string("bandwidth_stats_heading")), table);
statsDiv.append(
renderElement("h4", {}, "about-webrtc-bandwidth-stats-heading"),
table
);
return statsDiv;
}
@ -452,13 +505,13 @@ function renderFrameRateStats(report) {
const stats = history.entries.map(stat => {
stat.elapsed = stat.lastFrameTimestamp - stat.firstFrameTimestamp;
if (stat.elapsed < 1) {
stat.elapsed = 0;
stat.elapsed = "0.00";
}
stat.elapsed = (stat.elapsed / 1_000).toFixed(3);
if (stat.elapsed && stat.consecutiveFrames) {
stat.avgFramerate = (stat.consecutiveFrames / stat.elapsed).toFixed(2);
} else {
stat.avgFramerate = string("n_a");
stat.avgFramerate = "0.00";
}
return stat;
});
@ -466,17 +519,17 @@ function renderFrameRateStats(report) {
const table = renderSimpleTable(
"",
[
"width_px",
"height_px",
"consecutive_frames",
"time_elapsed",
"estimated_framerate",
"rotation_degrees",
"first_frame_timestamp",
"last_frame_timestamp",
"local_receive_ssrc",
"remote_send_ssrc",
].map(columnName => string(columnName)),
"about-webrtc-width-px",
"about-webrtc-height-px",
"about-webrtc-consecutive-frames",
"about-webrtc-time-elapsed",
"about-webrtc-estimated-framerate",
"about-webrtc-rotation-degrees",
"about-webrtc-first-frame-timestamp",
"about-webrtc-last-frame-timestamp",
"about-webrtc-local-receive-ssrc",
"about-webrtc-remote-send-ssrc",
],
stats.map(stat =>
[
stat.width,
@ -494,12 +547,9 @@ function renderFrameRateStats(report) {
);
statsDiv.append(
renderText(
"h4",
`${string("frame_stats_heading")} - MediaStreamTrack Id: ${
history.trackIdentifier
}`
),
renderElement("h4", {}, "about-webrtc-frame-stats-heading", {
"track-identifier": history.trackIdentifier,
}),
table
);
});
@ -534,7 +584,7 @@ function renderRTPStats(report, history) {
// Render stats set
return renderElements("div", { id: "rtp-stats: " + report.pcid }, [
renderText("h4", string("rtp_stats_heading")),
renderElement("h4", {}, "about-webrtc-rtp-stats-heading"),
...stats.map(stat => {
const { id, remoteId, remoteRtpStats } = stat;
const div = renderElements("div", {}, [
@ -559,32 +609,82 @@ function renderCoderStats({
discardedPackets,
packetsReceived,
}) {
let s = "";
let elements = [];
if (bitrateMean) {
s += ` ${string("avg_bitrate_label")}: ${(bitrateMean / 1000000).toFixed(
2
)} Mbps`;
elements.push(
renderElement(
"span",
{ className: "stat-label" },
"about-webrtc-avg-bitrate-label"
)
);
elements.push(
renderText("span", ` ${(bitrateMean / 1000000).toFixed(2)}`, {})
);
if (bitrateStdDev) {
s += ` (${(bitrateStdDev / 1000000).toFixed(2)} SD)`;
elements.push(
renderText("span", ` (${(bitrateStdDev / 1000000).toFixed(2)} SD)`, {})
);
}
}
if (framerateMean) {
s += ` ${string("avg_framerate_label")}: ${framerateMean.toFixed(2)} fps`;
if (bitrateMean) {
elements.push(
renderElement(
"span",
{ className: "stat-label" },
"about-webrtc-avg-framerate-label"
)
);
elements.push(
renderText("span", ` ${(framerateMean / 1000000).toFixed(2)}`, {})
);
if (framerateStdDev) {
s += ` (${framerateStdDev.toFixed(2)} SD)`;
elements.push(
renderText(
"span",
` (${(framerateStdDev / 1000000).toFixed(2)} SD)`,
{}
)
);
}
}
if (droppedFrames) {
s += ` ${string("dropped_frames_label")}: ${droppedFrames}`;
elements.push(
renderElement(
"span",
{ className: "stat-label" },
"about-webrtc-dropped-frames-label"
)
);
elements.push(renderText("span", ` ${droppedFrames}`, {}));
}
if (discardedPackets) {
s += ` ${string("discarded_packets_label")}: ${discardedPackets}`;
elements.push(
renderElement(
"span",
{ className: "stat-label" },
"about-webrtc-discarded-packets-label"
)
);
elements.push(renderText("span", ` ${discardedPackets}`, {}));
}
if (s.length) {
s = ` ${string(`${packetsReceived ? "de" : "en"}coder_label`)}:${s}`;
if (elements.length) {
if (packetsReceived) {
elements.unshift(
renderElement("span", {}, "about-webrtc-decoder-label"),
renderText("span", ": ")
);
} else {
elements.unshift(
renderElement("span", {}, "about-webrtc-encoder-label"),
renderText("span", ": ")
);
}
}
return renderText("p", s);
return renderElements("div", {}, elements);
}
function renderTransportStats(
@ -604,8 +704,6 @@ function renderTransportStats(
local,
history
) {
const typeLabel = local ? string("typeLocal") : string("typeRemote");
if (history) {
if (history[id] === undefined) {
history[id] = {};
@ -614,26 +712,48 @@ function renderTransportStats(
const estimateKbps = (timestamp, lastTimestamp, bytes, lastBytes) => {
if (!timestamp || !lastTimestamp || !bytes || !lastBytes) {
return string("n_a");
return "0.0";
}
const elapsedTime = timestamp - lastTimestamp;
if (elapsedTime <= 0) {
return string("n_a");
return "0.0";
}
return ((bytes - lastBytes) / elapsedTime).toFixed(1);
};
const time = new Date(timestamp).toTimeString();
let s = `${typeLabel}: ${time} ${type} SSRC: ${ssrc}`;
let elements = [];
if (local) {
elements.push(
renderElement("span", {}, "about-webrtc-type-local"),
renderText("span", ": ")
);
} else {
elements.push(
renderElement("span", {}, "about-webrtc-type-remote"),
renderText("span", ": ")
);
}
const time = new Date(timestamp).toTimeString();
elements.push(renderText("span", `${time} ${type} SSRC: ${ssrc}`));
const packets = string("packets");
if (packetsReceived) {
s += ` ${string("received_label")}: ${packetsReceived} ${packets}`;
elements.push(
renderElement(
"span",
{ className: "stat-label" },
"about-webrtc-received-label",
{
packets: packetsReceived,
}
)
);
if (bytesReceived) {
s += ` (${(bytesReceived / 1024).toFixed(2)} Kb`;
let s = ` (${(bytesReceived / 1024).toFixed(2)} Kb`;
if (local && history) {
s += ` , ~${estimateKbps(
s += ` , ${estimateKbps(
timestamp,
history[id].lastTimestamp,
bytesReceived,
@ -641,21 +761,48 @@ function renderTransportStats(
)} Kbps`;
}
s += ")";
elements.push(renderText("span", s));
}
s += ` ${string("lost_label")}: ${packetsLost} ${string(
"jitter_label"
)}: ${jitter}`;
elements.push(
renderElement(
"span",
{ className: "stat-label" },
"about-webrtc-lost-label",
{
packets: packetsReceived,
}
)
);
elements.push(
renderElement(
"span",
{ className: "stat-label" },
"about-webrtc-jitter-label",
{
jitter,
}
)
);
if (roundTripTime) {
s += ` RTT: ${roundTripTime * 1000} ms`;
elements.push(renderText("span", ` RTT: ${roundTripTime * 1000} ms`));
}
} else if (packetsSent) {
s += ` ${string("sent_label")}: ${packetsSent} ${packets}`;
elements.push(
renderElement(
"span",
{ className: "stat-label" },
"about-webrtc-sent-label",
{
packets: packetsSent,
}
)
);
if (bytesSent) {
s += ` (${(bytesSent / 1024).toFixed(2)} Kb`;
let s = ` (${(bytesSent / 1024).toFixed(2)} Kb`;
if (local && history) {
s += `, ~${estimateKbps(
s += `, ${estimateKbps(
timestamp,
history[id].lastTimestamp,
bytesSent,
@ -663,6 +810,7 @@ function renderTransportStats(
)} Kbps`;
}
s += ")";
elements.push(renderText("span", s));
}
}
@ -673,13 +821,13 @@ function renderTransportStats(
history[id].lastTimestamp = timestamp;
}
return renderText("p", s);
return renderElements("div", {}, elements);
}
function renderRawIceTable(caption, candidates) {
const table = renderSimpleTable(
"",
[string(caption)],
[caption],
[...new Set(candidates.sort())].filter(i => i).map(i => [i])
);
table.className = "raw-candidate";
@ -687,25 +835,25 @@ function renderRawIceTable(caption, candidates) {
}
function renderConfiguration(c) {
const provided = string("configuration_element_provided");
const notProvided = string("configuration_element_not_provided");
const provided = "about-webrtc-configuration-element-provided";
const notProvided = "about-webrtc-configuration-element-not-provided";
// Create the text for a configuration field
const cfg = (obj, key) => [
renderElement("br"),
`${key}: `,
key in obj ? obj[key] : renderText("i", notProvided),
key in obj ? obj[key] : renderElement("i", {}, notProvided),
];
// Create the text for a fooProvided configuration field
const pro = (obj, key) => [
renderElement("br"),
`${key}(`,
renderText("i", provided),
renderElement("i", {}, provided),
`/`,
renderText("i", notProvided),
renderElement("i", {}, notProvided),
`): `,
renderText("i", obj[`${key}Provided`] ? provided : notProvided),
renderElement("i", {}, obj[`${key}Provided`] ? provided : notProvided),
];
return renderElements("div", { classList: "peer-connection-config" }, [
@ -717,7 +865,7 @@ function renderConfiguration(c) {
renderElement("br"),
"iceServers: ",
...(!c.iceServers
? [renderText("i", notProvided)]
? [renderElement("i", {}, notProvided)]
: c.iceServers.map(i =>
renderElements("div", {}, [
`urls: ${JSON.stringify(i.urls)}`,
@ -730,33 +878,16 @@ function renderConfiguration(c) {
function renderICEStats(report) {
const iceDiv = renderElements("div", { id: "ice-stats: " + report.pcid }, [
renderText("h4", string("ice_stats_heading")),
renderElement("h4", {}, "about-webrtc-ice-stats-heading"),
]);
// Render ICECandidate table
{
const caption = renderElement("caption", { className: "no-print" });
// This takes the caption message with the replacement token, breaks
// it around the token, and builds the spans for each portion of the
// caption. This is to allow localization to put the color name for
// the highlight wherever it is appropriate in the translated string
// while avoiding innerHTML warnings from eslint.
const [start, end] = string("trickle_caption_msg2").split(/%(?:1\$)?S/);
// only append span if non-whitespace chars present
if (/\S/.test(start)) {
caption.append(renderText("span", start));
}
caption.append(
renderText("span", string("trickle_highlight_color_name2"), {
className: "ice-trickled",
})
const caption = renderElement(
"caption",
{ className: "no-print" },
"about-webrtc-trickle-caption-msg"
);
// only append span if non-whitespace chars present
if (/\S/.test(end)) {
caption.append(renderText("span", end));
}
// Generate ICE stats
const stats = [];
@ -833,16 +964,16 @@ function renderICEStats(report) {
const statsTable = renderSimpleTable(
caption,
[
"ice_state",
"nominated",
"selected",
"local_candidate",
"remote_candidate",
"ice_component_id",
"priority",
"ice_pair_bytes_sent",
"ice_pair_bytes_received",
].map(columnName => string(columnName)),
"about-webrtc-ice-state",
"about-webrtc-nominated",
"about-webrtc-selected",
"about-webrtc-local-candidate",
"about-webrtc-remote-candidate",
"about-webrtc-ice-component-id",
"about-webrtc-priority",
"about-webrtc-ice-pair-bytes-sent",
"about-webrtc-ice-pair-bytes-received",
],
stats.map(stat =>
[
stat.state,
@ -903,25 +1034,34 @@ function renderICEStats(report) {
// counts and the ICE candidate pair table above.
iceDiv.append(
renderElement("br"),
renderIceMetric("ice_restart_count_label", report.iceRestarts),
renderIceMetric("ice_rollback_count_label", report.iceRollbacks)
renderIceMetric("about-webrtc-ice-restart-count-label", report.iceRestarts),
renderIceMetric(
"about-webrtc-ice-rollback-count-label",
report.iceRollbacks
)
);
// Render raw ICECandidate section
{
const section = renderElements("div", {}, [
renderText("h4", string("raw_candidates_heading")),
renderElement("h4", {}, "about-webrtc-raw-candidates-heading"),
]);
const foldSection = renderFoldableSection(section, {
showMsg: string("raw_cand_show_msg"),
hideMsg: string("raw_cand_hide_msg"),
showMsg: "about-webrtc-raw-cand-show-msg",
hideMsg: "about-webrtc-raw-cand-hide-msg",
});
// render raw candidates
foldSection.append(
renderElements("div", {}, [
renderRawIceTable("raw_local_candidate", report.rawLocalCandidates),
renderRawIceTable("raw_remote_candidate", report.rawRemoteCandidates),
renderRawIceTable(
"about-webrtc-raw-local-candidate",
report.rawLocalCandidates
),
renderRawIceTable(
"about-webrtc-raw-remote-candidate",
report.rawRemoteCandidates
),
])
);
section.append(foldSection);
@ -932,7 +1072,7 @@ function renderICEStats(report) {
function renderIceMetric(label, value) {
return renderElements("div", {}, [
renderText("span", `${string(label)}: `, { className: "info-label" }),
renderElement("span", { className: "info-label" }, label),
renderText("span", value, { className: "info-body" }),
]);
}
@ -987,7 +1127,11 @@ function renderUserPrefs() {
},
[
renderElements("span", { className: "section-heading" }, [
renderText("h3", string("custom_webrtc_configuration_heading")),
renderElement(
"h3",
{},
"about-webrtc-custom-webrtc-configuration-heading"
),
]),
...display,
]
@ -1006,7 +1150,7 @@ function renderFoldableSection(parent, options = {}) {
}
function renderSimpleTable(caption, headings, data) {
const heads = headings.map(text => renderText("th", text));
const heads = headings.map(text => renderElement("th", {}, text));
const renderCell = text => renderText("td", text);
return renderElements("table", {}, [
@ -1022,15 +1166,11 @@ class FoldEffect {
constructor(
target,
{
showMsg = string("fold_show_msg"),
showHint = string("fold_show_hint"),
hideMsg = string("fold_hide_msg"),
hideHint = string("fold_hide_hint"),
showMsg = "about-webrtc-fold-show-msg",
hideMsg = "about-webrtc-fold-hide-msg",
} = {}
) {
showMsg = `\u25BC ${showMsg}`;
hideMsg = `\u25B2 ${hideMsg}`;
Object.assign(this, { target, showMsg, showHint, hideMsg, hideHint });
Object.assign(this, { target, showMsg, hideMsg });
}
render() {
@ -1050,14 +1190,12 @@ class FoldEffect {
expand() {
this.target.classList.remove("fold-closed");
this.trigger.setAttribute("title", this.hideHint);
this.trigger.textContent = this.hideMsg;
document.l10n.setAttributes(this.trigger, this.hideMsg);
}
collapse() {
this.target.classList.add("fold-closed");
this.trigger.setAttribute("title", this.showHint);
this.trigger.textContent = this.showMsg;
document.l10n.setAttributes(this.trigger, this.showMsg);
}
static expandAll() {

View File

@ -1,186 +0,0 @@
# 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 (document_title):
# The text "WebRTC" is a proper noun and should not be translated.
# It is the general label for the standards based technology. see http://www.webrtc.org
document_title = WebRTC Internals
# LOCALIZATION NOTE (save_page_msg):
# %1$S will be replaced by a full path file name: the target of the SavePage operation.
save_page_msg = page saved to: %1$S
# LOCALIZATION NOTE (save_page_dialog_title): "about:webrtc" is a internal browser URL and should not be
# translated. This string is used as a title for a file save dialog box.
save_page_dialog_title = save about:webrtc as
# LOCALIZATION NOTE (debug_mode_off_state_msg):
# %1$S will be replaced by the full path file name of the debug log.
debug_mode_off_state_msg = trace log can be found at: %1$S
# LOCALIZATION NOTE (debug_mode_on_state_msg):
# %1$S will be replaced by the full path file name of the debug log.
debug_mode_on_state_msg = debug mode active, trace log at: %1$S
# LOCALIZATION NOTE (aec_logging_msg_label, aec_logging_off_state_label,
# aec_logging_on_state_label, aec_logging_on_state_msg):
# AEC is an abbreviation for Acoustic Echo Cancellation.
aec_logging_msg_label = AEC Logging
aec_logging_off_state_label = Start AEC Logging
aec_logging_on_state_label = Stop AEC Logging
aec_logging_on_state_msg = AEC logging active (speak with the caller for a few minutes and then stop the capture)
# LOCALIZATION NOTE (aec_logging_off_state_msg):
# %1$S will be replaced by the full path to the directory containing the captured log files.
# AEC is an abbreviation for Acoustic Echo Cancellation.
aec_logging_off_state_msg = captured log files can be found in: %1$S
# LOCALIZATION NOTE (peer_connection_id_label): "PeerConnection" is a proper noun
# associated with the WebRTC module. "ID" is an abbreviation for Identifier. This string
# should not normally be translated and is used as a data label.
peer_connection_id_label = PeerConnection ID
# LOCALIZATION NOTE (sdp_heading, local_sdp_heading, remote_sdp_heading, sdp_history_heading, sdp_parsing_errors_heading):
# "SDP" is an abbreviation for Session Description Protocol, an IETF standard.
# See http://wikipedia.org/wiki/Session_Description_Protocol
sdp_heading = SDP
local_sdp_heading = Local SDP
remote_sdp_heading = Remote SDP
sdp_history_heading = SDP History
sdp_parsing_errors_heading = SDP Parsing Errors
# LOCALIZATION NOTE (sdp_set_at_timestamp): the local or remote SDP and when it was set
# %1$S will be replaced by local_sdp_heading or remote sdp_heading and %2$S
# will be a numeric timestamp.
sdp_set_at_timestamp = Set %1$S at timestamp %2$S
# LOCALIZATION NOTE (sdp_set_timestamp): the absolute and relative times
# when the sdp was set. %1$S and $2$S are both numeric timestamps. The
# first is the absolute time, the second is the elapsed time since the
# first sdp was set. ms is an abbreviation for milliseconds.
sdp_set_timestamp = Timestamp %1$S (+ %2$S ms)
# LOCALIZATION NOTE (offer, answer):
# offer and answer describe whether the local sdp is an offer or answer or
# the remote sdp is an offer or answer. These are appended to the local and
# remote sdp headings.
offer = Offer
answer = Answer
# LOCALIZATION NOTE (rtp_stats_heading): "RTP" is an abbreviation for the
# Real-time Transport Protocol, an IETF specification, and should not
# normally be translated. "Stats" is an abbreviation for Statistics.
rtp_stats_heading = RTP Stats
# LOCALIZATION NOTE (ice_state, ice_stats_heading): "ICE" is an abbreviation
# for Interactive Connectivity Establishment, which is an IETF protocol,
# and should not normally be translated. "Stats" is an abbreviation for
# Statistics.
ice_state = ICE State
ice_stats_heading = ICE Stats
ice_restart_count_label = ICE restarts
ice_rollback_count_label = ICE rollbacks
ice_pair_bytes_sent = Bytes sent
ice_pair_bytes_received = Bytes received
ice_component_id = Component ID
# LOCALIZATION NOTE (avg_bitrate_label, avg_framerate_label): "Avg." is an abbreviation
# for Average. These are used as data labels.
avg_bitrate_label = Avg. bitrate
avg_framerate_label = Avg. framerate
# LOCALIZATION NOTE (typeLocal, typeRemote): These adjectives are used to label a
# line of statistics collected for a peer connection. The data represents
# either the local or remote end of the connection.
typeLocal = Local
typeRemote = Remote
# LOCALIZATION NOTE (nominated): This adjective is used to label a table column.
# Cells in this column contain the localized javascript string representation of "true"
# or are left blank.
nominated = Nominated
# LOCALIZATION NOTE (selected): This adjective is used to label a table column.
# Cells in this column contain the localized javascript string representation of "true"
# or are left blank. This represents an attribute of an ICE candidate.
selected = Selected
# LOCALIZATION NOTE (trickle_caption_msg2, trickle_highlight_color_name2): ICE
# candidates arriving after the remote answer arrives are considered trickled
# (an attribute of an ICE candidate). These are highlighted in the ICE stats
# table with light blue background. %S is replaced by
# trickle_highlight_color_name2 ("blue"), highlighted with a light blue
# background to visually match the trickled ICE candidates.
trickle_caption_msg2 = Trickled candidates (arriving after answer) are highlighted in %S
trickle_highlight_color_name2 = blue
save_page_label = Save Page
debug_mode_msg_label = Debug Mode
debug_mode_off_state_label = Start Debug Mode
debug_mode_on_state_label = Stop Debug Mode
stats_heading = Session Statistics
stats_clear = Clear History
log_heading = Connection Log
log_clear = Clear Log
log_show_msg = show log
log_hide_msg = hide log
connection_closed = closed
local_candidate = Local Candidate
remote_candidate = Remote Candidate
raw_candidates_heading = All Raw Candidates
raw_local_candidate = Raw Local Candidate
raw_remote_candidate = Raw Remote Candidate
raw_cand_show_msg = show raw candidates
raw_cand_hide_msg = hide raw candidates
priority = Priority
fold_show_msg = show details
fold_show_hint = click to expand this section
fold_hide_msg = hide details
fold_hide_hint = click to collapse this section
dropped_frames_label = Dropped frames
discarded_packets_label = Discarded packets
decoder_label = Decoder
encoder_label = Encoder
received_label = Received
packets = packets
lost_label = Lost
jitter_label = Jitter
sent_label = Sent
show_tab_label = Show tab
frame_stats_heading = Video Frame Statistics
n_a = N/A
width_px = Width (px)
height_px = Height (px)
consecutive_frames = Consecutive Frames
time_elapsed = Time Elapsed (s)
estimated_framerate = Estimated Framerate
rotation_degrees = Rotation (degrees)
first_frame_timestamp = First Frame Reception Timestamp
last_frame_timestamp = Last Frame Reception Timestamp
# SSRCs are identifiers that represent endpoints in an RTP stream
# This is an SSRC on the local side of the connection that is receiving RTP
local_receive_ssrc = Local Receiving SSRC
# This is an SSRC on the remote side of the connection that is sending RTP
remote_send_ssrc = Remote Sending SSRC
# An option whose value will not be displayed but instead noted as having been
# provided
configuration_element_provided = Provided
# An option whose value will not be displayed but instead noted as having not
# been provided
configuration_element_not_provided = Not Provided
# The options set by the user in about:config that could impact a WebRTC call
custom_webrtc_configuration_heading = User Set WebRTC Preferences
# Section header for estimated bandwidths of WebRTC media flows
bandwidth_stats_heading = Estimated Bandwidth
# The ID of the MediaStreamTrack
track_identifier = Track Identifier
# The estimated bandwidth available for sending WebRTC media in bytes per second
send_bandwidth_bytes_sec = Send Bandwidth (bytes/sec)
# The estimated bandwidth available for receiving WebRTC media in bytes per second
receive_bandwidth_bytes_sec = Receive Bandwidth (bytes/sec)
# Maximum number of bytes per second that will be padding zeros at the ends of packets
max_padding_bytes_sec = Maximum Padding (bytes/sec)
# The amount of time inserted between packets to keep them spaced out
pacer_delay_ms = Pacer Delay ms
# The amount of time it takes for a packet to travel from the local machine to the remote machine,
# and then have a packet return
round_trip_time_ms = RTT ms

View File

@ -0,0 +1,249 @@
# 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 for about:webrtc, a troubleshooting and diagnostic page
### for WebRTC calls. See https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API.
# The text "WebRTC" is a proper noun and should not be translated.
about-webrtc-document-title = WebRTC Internals
# "about:webrtc" is a internal browser URL and should not be
# translated. This string is used as a title for a file save dialog box.
about-webrtc-save-page-dialog-title = save about:webrtc as
## AEC is an abbreviation for Acoustic Echo Cancellation.
about-webrtc-aec-logging-msg-label = AEC Logging
about-webrtc-aec-logging-off-state-label = Start AEC Logging
about-webrtc-aec-logging-on-state-label = Stop AEC Logging
about-webrtc-aec-logging-on-state-msg = AEC logging active (speak with the caller for a few minutes and then stop the capture)
##
# "PeerConnection" is a proper noun associated with the WebRTC module. "ID" is
# an abbreviation for Identifier. This string should not normally be translated
# and is used as a data label.
about-webrtc-peerconnection-id-label = PeerConnection ID:
## "SDP" is an abbreviation for Session Description Protocol, an IETF standard.
## See http://wikipedia.org/wiki/Session_Description_Protocol
about-webrtc-sdp-heading = SDP
about-webrtc-local-sdp-heading = Local SDP
about-webrtc-local-sdp-heading-offer = Local SDP (Offer)
about-webrtc-local-sdp-heading-answer = Local SDP (Answer)
about-webrtc-remote-sdp-heading = Remote SDP
about-webrtc-remote-sdp-heading-offer = Remote SDP (Offer)
about-webrtc-remote-sdp-heading-answer = Remote SDP (Answer)
about-webrtc-sdp-history-heading = SDP History
about-webrtc-sdp-parsing-errors-heading = SDP Parsing Errors
##
# "RTP" is an abbreviation for the Real-time Transport Protocol, an IETF
# specification, and should not normally be translated. "Stats" is an
# abbreviation for Statistics.
about-webrtc-rtp-stats-heading = RTP Stats
## "ICE" is an abbreviation for Interactive Connectivity Establishment, which
## is an IETF protocol, and should not normally be translated.
about-webrtc-ice-state = ICE State
# "Stats" is an abbreviation for Statistics.
about-webrtc-ice-stats-heading = ICE Stats
about-webrtc-ice-restart-count-label = ICE restarts:
about-webrtc-ice-rollback-count-label = ICE rollbacks:
about-webrtc-ice-pair-bytes-sent = Bytes sent:
about-webrtc-ice-pair-bytes-received = Bytes received:
about-webrtc-ice-component-id = Component ID
##
## "Avg." is an abbreviation for Average. These are used as data labels.
about-webrtc-avg-bitrate-label = Avg. bitrate:
about-webrtc-avg-framerate-label = Avg. framerate:
##
## These adjectives are used to label a line of statistics collected for a peer
## connection. The data represents either the local or remote end of the
## connection.
about-webrtc-type-local = Local
about-webrtc-type-remote = Remote
##
# This adjective is used to label a table column. Cells in this column contain
# the localized javascript string representation of "true" or are left blank.
about-webrtc-nominated = Nominated
# This adjective is used to label a table column. Cells in this column contain
# the localized javascript string representation of "true" or are left blank.
# This represents an attribute of an ICE candidate.
about-webrtc-selected = Selected
about-webrtc-save-page-label = Save Page
about-webrtc-debug-mode-msg-label = Debug Mode
about-webrtc-debug-mode-off-state-label = Start Debug Mode
about-webrtc-debug-mode-on-state-label = Stop Debug Mode
about-webrtc-stats-heading = Session Statistics
about-webrtc-stats-clear = Clear History
about-webrtc-log-heading = Connection Log
about-webrtc-log-clear = Clear Log
about-webrtc-log-show-msg = show log
.title = click to expand this section
about-webrtc-log-hide-msg = hide log
.title = click to collapse this section
## These are used to display a header for a PeerConnection.
## Variables:
## $browser-id (Number) - A numeric id identifying the browser tab for the PeerConnection.
## $id (String) - A globally unique identifier for the PeerConnection.
## $url (String) - The url of the site which opened the PeerConnection.
## $now (Date) - The JavaScript timestamp at the time the report was generated.
about-webrtc-connection-open = [ { $browser-id } | { $id } ] { $url } { $now }
about-webrtc-connection-closed = [ { $browser-id } | { $id } ] { $url } (closed) { $now }
##
about-webrtc-local-candidate = Local Candidate
about-webrtc-remote-candidate = Remote Candidate
about-webrtc-raw-candidates-heading = All Raw Candidates
about-webrtc-raw-local-candidate = Raw Local Candidate
about-webrtc-raw-remote-candidate = Raw Remote Candidate
about-webrtc-raw-cand-show-msg = show raw candidates
.title = click to expand this section
about-webrtc-raw-cand-hide-msg = hide raw candidates
.title = click to collapse this section
about-webrtc-priority = Priority
about-webrtc-fold-show-msg = show details
.title = click to expand this section
about-webrtc-fold-hide-msg = hide details
.title = click to collapse this section
about-webrtc-dropped-frames-label = Dropped frames:
about-webrtc-discarded-packets-label = Discarded packets:
about-webrtc-decoder-label = Decoder
about-webrtc-encoder-label = Encoder
about-webrtc-show-tab-label = Show tab
about-webrtc-width-px = Width (px)
about-webrtc-height-px = Height (px)
about-webrtc-consecutive-frames = Consecutive Frames
about-webrtc-time-elapsed = Time Elapsed (s)
about-webrtc-estimated-framerate = Estimated Framerate
about-webrtc-rotation-degrees = Rotation (degrees)
about-webrtc-first-frame-timestamp = First Frame Reception Timestamp
about-webrtc-last-frame-timestamp = Last Frame Reception Timestamp
## SSRCs are identifiers that represent endpoints in an RTP stream
# This is an SSRC on the local side of the connection that is receiving RTP
about-webrtc-local-receive-ssrc = Local Receiving SSRC
# This is an SSRC on the remote side of the connection that is sending RTP
about-webrtc-remote-send-ssrc = Remote Sending SSRC
##
# An option whose value will not be displayed but instead noted as having been
# provided
about-webrtc-configuration-element-provided = Provided
# An option whose value will not be displayed but instead noted as having not
# been provided
about-webrtc-configuration-element-not-provided = Not Provided
# The options set by the user in about:config that could impact a WebRTC call
about-webrtc-custom-webrtc-configuration-heading = User Set WebRTC Preferences
# Section header for estimated bandwidths of WebRTC media flows
about-webrtc-bandwidth-stats-heading = Estimated Bandwidth
# The ID of the MediaStreamTrack
about-webrtc-track-identifier = Track Identifier
# The estimated bandwidth available for sending WebRTC media in bytes per second
about-webrtc-send-bandwidth-bytes-sec = Send Bandwidth (bytes/sec)
# The estimated bandwidth available for receiving WebRTC media in bytes per second
about-webrtc-receive-bandwidth-bytes-sec = Receive Bandwidth (bytes/sec)
# Maximum number of bytes per second that will be padding zeros at the ends of packets
about-webrtc-max-padding-bytes-sec = Maximum Padding (bytes/sec)
# The amount of time inserted between packets to keep them spaced out
about-webrtc-pacer-delay-ms = Pacer Delay ms
# The amount of time it takes for a packet to travel from the local machine to the remote machine,
# and then have a packet return
about-webrtc-round-trip-time-ms = RTT ms
# This is a section heading for video frame statistics for a MediaStreamTrack.
# see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack.
# Variables:
# $track-identifier (String) - The unique identifier for the MediaStreamTrack.
about-webrtc-frame-stats-heading = Video Frame Statistics - MediaStreamTrack ID: { $track-identifier }
## These are paths used for saving the about:webrtc page or log files so
## they can be attached to bug reports.
## Variables:
## $path (String) - The path to which the file is saved.
about-webrtc-save-page-msg = page saved to: { $path }
about-webrtc-debug-mode-off-state-msg = trace log can be found at: { $path }
about-webrtc-debug-mode-on-state-msg = debug mode active, trace log at: { $path }
about-webrtc-aec-logging-off-state-msg = captured log files can be found in: { $path }
##
# This is the total number of packets received on the PeerConnection.
# Variables:
# $packets (Number) - The number of packets received.
about-webrtc-received-label =
{ $packets ->
[one] Received { $packets } packet
*[other] Received { $packets } packets
}
# This is the total number of packets lost by the PeerConnection.
# Variables:
# $packets (Number) - The number of packets lost.
about-webrtc-lost-label =
{ $packets ->
[one] Lost { $packets } packet
*[other] Lost { $packets } packets
}
# This is the total number of packets sent by the PeerConnection.
# Variables:
# $packets (Number) - The number of packets sent.
about-webrtc-sent-label =
{ $packets ->
[one] Sent { $packets } packet
*[other] Sent { $packets } packets
}
# Jitter is the variance in the arrival time of packets.
# See: https://w3c.github.io/webrtc-stats/#dom-rtcreceivedrtpstreamstats-jitter
# Variables:
# $jitter (Number) - The jitter.
about-webrtc-jitter-label = Jitter { $jitter }
# ICE candidates arriving after the remote answer arrives are considered trickled
# (an attribute of an ICE candidate). These are highlighted in the ICE stats
# table with light blue background.
about-webrtc-trickle-caption-msg = Trickled candidates (arriving after answer) are highlighted in blue
## "SDP" is an abbreviation for Session Description Protocol, an IETF standard.
## See http://wikipedia.org/wiki/Session_Description_Protocol
# This is used as a header for local SDP.
# Variables:
# $timestamp (Number) - The Unix Epoch time at which the SDP was set.
about-webrtc-sdp-set-at-timestamp-local = Set Local SDP at timestamp { NUMBER($timestamp, useGrouping: "false") }
# This is used as a header for remote SDP.
# Variables:
# $timestamp (Number) - The Unix Epoch time at which the SDP was set.
about-webrtc-sdp-set-at-timestamp-remote = Set Remote SDP at timestamp { NUMBER($timestamp, useGrouping: "false") }
# This is used as a header for an SDP section contained in two columns allowing for side-by-side comparisons.
# Variables:
# $timestamp (Number) - The Unix Epoch time at which the SDP was set.
# $relative-timestamp (Number) - The timestamp relative to the timestamp of the earliest received SDP.
about-webrtc-sdp-set-timestamp = Timestamp { NUMBER($timestamp, useGrouping: "false") } (+ { $relative-timestamp } ms)
##

View File

@ -11,7 +11,6 @@
% locale global @AB_CD@ %locale/@AB_CD@/global/
locale/@AB_CD@/global/aboutReader.properties (%chrome/global/aboutReader.properties)
locale/@AB_CD@/global/aboutStudies.properties (%chrome/global/aboutStudies.properties)
locale/@AB_CD@/global/aboutWebrtc.properties (%chrome/global/aboutWebrtc.properties)
locale/@AB_CD@/global/autocomplete.properties (%chrome/global/autocomplete.properties)
locale/@AB_CD@/global/appPicker.dtd (%chrome/global/appPicker.dtd)
locale/@AB_CD@/global/browser.properties (%chrome/global/browser.properties)