richard pushed to branch tor-browser-115.9.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits: d4a4b72b by Henry Wilkes at 2024-04-09T19:54:28+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Bug 42207: Migrate preferences strings to Fluent.
- - - - - 6b080bf1 by Henry Wilkes at 2024-04-09T19:54:28+00:00 fixup! Tor Browser strings
Bug 42207: Migrate preferences strings to Fluent.
- - - - - 7ff82efa by Henry Wilkes at 2024-04-09T19:54:28+00:00 fixup! Add TorStrings module for localization
Bug 42207: Migrate preferences strings to Fluent.
- - - - - 446e78a5 by Henry Wilkes at 2024-04-09T19:54:28+00:00 fixup! Tor Browser localization migration scripts.
Bug 42207: Migrate preferences to Fluent.
- - - - -
19 changed files:
- browser/components/torpreferences/content/bridgeQrDialog.js - browser/components/torpreferences/content/bridgeQrDialog.xhtml - browser/components/torpreferences/content/builtinBridgeDialog.js - browser/components/torpreferences/content/builtinBridgeDialog.xhtml - browser/components/torpreferences/content/connectionCategory.inc.xhtml - browser/components/torpreferences/content/connectionPane.js - browser/components/torpreferences/content/connectionPane.xhtml - browser/components/torpreferences/content/connectionSettingsDialog.js - browser/components/torpreferences/content/connectionSettingsDialog.xhtml - browser/components/torpreferences/content/provideBridgeDialog.js - browser/components/torpreferences/content/requestBridgeDialog.js - browser/components/torpreferences/content/requestBridgeDialog.xhtml - browser/components/torpreferences/content/torLogDialog.js - browser/components/torpreferences/content/torLogDialog.xhtml - browser/components/torpreferences/content/torPreferences.css - browser/locales/en-US/browser/tor-browser.ftl - toolkit/modules/TorStrings.sys.mjs - toolkit/torbutton/chrome/locale/en-US/settings.properties - + tools/torbrowser/l10n/migrations/bug-42207-settings.py
Changes:
===================================== browser/components/torpreferences/content/bridgeQrDialog.js ===================================== @@ -4,19 +4,11 @@ const { QRCode } = ChromeUtils.importESModule( "resource://gre/modules/QRCode.sys.mjs" );
-const { TorStrings } = ChromeUtils.importESModule( - "resource://gre/modules/TorStrings.sys.mjs" -); - window.addEventListener( "DOMContentLoaded", () => { const bridgeString = window.arguments[0];
- document.documentElement.setAttribute( - "title", - TorStrings.settings.scanQrTitle - ); const target = document.getElementById("bridgeQr-target"); const style = window.getComputedStyle(target); // We are assuming that the style width and height have "px" units.
===================================== browser/components/torpreferences/content/bridgeQrDialog.xhtml ===================================== @@ -7,8 +7,13 @@ type="child" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" + data-l10n-id="bridge-qr-dialog-title"
<dialog id="bridgeQr-dialog" buttons="accept"> + <linkset> + <html:link rel="localization" href="browser/tor-browser.ftl" /> + </linkset> + <script src="chrome://browser/content/torpreferences/bridgeQrDialog.js" />
<html:div id="bridgeQr">
===================================== browser/components/torpreferences/content/builtinBridgeDialog.js ===================================== @@ -1,9 +1,5 @@ "use strict";
-const { TorStrings } = ChromeUtils.importESModule( - "resource://gre/modules/TorStrings.sys.mjs" -); - const { TorSettings, TorBridgeSource } = ChromeUtils.importESModule( "resource://gre/modules/TorSettings.sys.mjs" ); @@ -16,34 +12,10 @@ const gBuiltinBridgeDialog = { init() { this._result = window.arguments[0];
- document.documentElement.setAttribute( - "title", - TorStrings.settings.builtinBridgeHeader - ); - - document.getElementById( - "torPreferences-builtinBridge-description" - ).textContent = TorStrings.settings.builtinBridgeDescription2; - this._radioGroup = document.getElementById( "torPreferences-builtinBridge-typeSelection" );
- const typeStrings = { - obfs4: { - label: TorStrings.settings.builtinBridgeObfs4Title, - descr: TorStrings.settings.builtinBridgeObfs4Description2, - }, - snowflake: { - label: TorStrings.settings.builtinBridgeSnowflake, - descr: TorStrings.settings.builtinBridgeSnowflakeDescription2, - }, - "meek-azure": { - label: TorStrings.settings.builtinBridgeMeekAzure, - descr: TorStrings.settings.builtinBridgeMeekAzureDescription2, - }, - }; - const currentBuiltinType = TorSettings.bridges.enabled && TorSettings.bridges.source == TorBridgeSource.BuiltIn @@ -56,16 +28,18 @@ const gBuiltinBridgeDialog = { const radio = optionEl.querySelector("radio"); const type = radio.value; optionEl.hidden = !TorSettings.builtinBridgeTypes.includes(type); - radio.label = typeStrings[type].label; + const descriptionEl = optionEl.querySelector( ".builtin-bridges-option-description" ); - descriptionEl.textContent = typeStrings[type].descr; + // Set an id to be used for the aria-describedby. + descriptionEl.id = `builtin-bridges-description-${type}`; const currentBadge = optionEl.querySelector(".bridge-status-badge"); if (type === currentBuiltinType) { const currentLabelEl = optionEl.querySelector( ".torPreferences-current-bridge-label" ); + currentLabelEl.id = `builtin-bridges-current-${type}`; // Described by both the current badge and the full description. // These will be concatenated together in the screen reader output. radio.setAttribute( @@ -77,6 +51,7 @@ const gBuiltinBridgeDialog = { } else { // No visible badge. radio.setAttribute("aria-describedby", descriptionEl.id); + currentBadge.classList.remove("bridge-status-current-built-in"); } }
@@ -117,10 +92,8 @@ const gBuiltinBridgeDialog = { const connect = TorConnect.canBeginBootstrap; this._result.connect = connect; this._acceptButton.setAttribute( - "label", - connect - ? TorStrings.settings.bridgeButtonConnect - : TorStrings.settings.bridgeButtonAccept + "data-l10n-id", + connect ? "bridge-dialog-button-connect" : "bridge-dialog-button-accept" ); },
===================================== browser/components/torpreferences/content/builtinBridgeDialog.xhtml ===================================== @@ -7,26 +7,30 @@ type="child" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" + data-l10n-id="built-in-dialog-title"
<dialog id="torPreferences-builtinBridge-dialog" buttons="accept,cancel"> <linkset> + <html:link rel="localization" href="branding/brand.ftl" /> <html:link rel="localization" href="browser/tor-browser.ftl" /> </linkset>
<script src="chrome://browser/content/torpreferences/builtinBridgeDialog.js" />
- <description id="torPreferences-builtinBridge-description"> </description> + <description data-l10n-id="built-in-dialog-introduction"></description> <radiogroup id="torPreferences-builtinBridge-typeSelection"> <vbox class="builtin-bridges-option"> <hbox> <!-- The radio option is described by both the "Current bridge" label - and the full description. If the "Connected" label is hidden, then - only the latter description should contribute. --> - <radio value="obfs4" /> + <radio + value="obfs4" + data-l10n-id="built-in-dialog-obfs4-radio-option" + /> <html:span class="bridge-status-badge"> <html:div class="bridge-status-icon"></html:div> <html:span - id="obfs-bridges-current" class="torPreferences-current-bridge-label" data-l10n-id="built-in-dialog-current-bridge-label" > @@ -34,18 +38,20 @@ </html:span> </hbox> <html:div - id="obfs-bridges-description" class="indent builtin-bridges-option-description" + data-l10n-id="tor-bridges-built-in-obfs4-description" > </html:div> </vbox> <vbox class="builtin-bridges-option"> <hbox> - <radio value="snowflake" /> + <radio + value="snowflake" + data-l10n-id="built-in-dialog-snowflake-radio-option" + /> <html:span class="bridge-status-badge"> <html:div class="bridge-status-icon"></html:div> <html:span - id="snowflake-bridges-current" class="torPreferences-current-bridge-label" data-l10n-id="built-in-dialog-current-bridge-label" > @@ -53,18 +59,20 @@ </html:span> </hbox> <html:div - id="snowflake-bridges-description" class="indent builtin-bridges-option-description" + data-l10n-id="tor-bridges-built-in-snowflake-description" > </html:div> </vbox> <vbox class="builtin-bridges-option"> <hbox> - <radio value="meek-azure" /> + <radio + value="meek-azure" + data-l10n-id="built-in-dialog-meek-azure-radio-option" + /> <html:span class="bridge-status-badge"> <html:div class="bridge-status-icon"></html:div> <html:span - id="meek-bridges-current" class="torPreferences-current-bridge-label" data-l10n-id="built-in-dialog-current-bridge-label" > @@ -72,8 +80,8 @@ </html:span> </hbox> <html:div - id="meek-bridges-description" class="indent builtin-bridges-option-description" + data-l10n-id="tor-bridges-built-in-meek-azure-description" > </html:div> </vbox>
===================================== browser/components/torpreferences/content/connectionCategory.inc.xhtml ===================================== @@ -5,5 +5,5 @@ align="center" hidden="true"> <image class="category-icon"/> - <label id="torPreferences-labelCategory" class="category-name" flex="1" value="Connection"/> + <label class="category-name" flex="1" data-l10n-id="tor-connection-settings-heading"></label> </richlistitem>
===================================== browser/components/torpreferences/content/connectionPane.js ===================================== @@ -1088,18 +1088,17 @@ const gBuiltinBridgesArea = { * @type {Object<string,object>} */ _bridgeTypeStrings: { - // TODO: Change to Fluent ids. obfs4: { - name: TorStrings.settings.builtinBridgeObfs4Title, - description: TorStrings.settings.builtinBridgeObfs4Description2, + name: "tor-bridges-built-in-obfs4-name", + description: "tor-bridges-built-in-obfs4-description", }, snowflake: { - name: TorStrings.settings.builtinBridgeSnowflake, - description: TorStrings.settings.builtinBridgeSnowflakeDescription2, + name: "tor-bridges-built-in-snowflake-name", + description: "tor-bridges-built-in-snowflake-description", }, "meek-azure": { - name: TorStrings.settings.builtinBridgeMeekAzure, - description: TorStrings.settings.builtinBridgeMeekAzureDescription2, + name: "tor-bridges-built-in-meek-azure-name", + description: "tor-bridges-built-in-meek-azure-description", }, },
@@ -1151,15 +1150,11 @@ const gBuiltinBridgesArea = {
const bridgeStrings = this._bridgeTypeStrings[bridgeType]; if (bridgeStrings) { - /* document.l10n.setAttributes(this._nameEl, bridgeStrings.name); document.l10n.setAttributes( this._descriptionEl, bridgeStrings.description ); - */ - this._nameEl.textContent = bridgeStrings.name; - this._descriptionEl.textContent = bridgeStrings.description; } else { // Unknown type, or no type. this._nameEl.removeAttribute("data-l10n-id"); @@ -2075,7 +2070,7 @@ const gBridgeSettings = { // "Remove all bridges"? document .getElementById("tor-bridges-options-remove-all-menu-item") - .addEventListener("click", () => { + .addEventListener("click", async () => { // TODO: Should we only have a warning when not built-in? const parentWindow = Services.wm.getMostRecentWindow("navigator:browser"); @@ -2085,13 +2080,20 @@ const gBridgeSettings = { Services.prompt.BUTTON_POS_0_DEFAULT + Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_CANCEL;
+ const [titleString, bodyString, removeString] = + await document.l10n.formatValues([ + { id: "remove-all-bridges-warning-title" }, + { id: "remove-all-bridges-warning-description" }, + { id: "remove-all-bridges-warning-remove-button" }, + ]); + // TODO: Update the text, and remove old strings. const buttonIndex = Services.prompt.confirmEx( parentWindow, - TorStrings.settings.bridgeRemoveAllDialogTitle, - TorStrings.settings.bridgeRemoveAllDialogDescription, + titleString, + bodyString, flags, - TorStrings.settings.remove, + removeString, null, null, null, @@ -2289,36 +2291,13 @@ const gBridgeSettings = { const gConnectionPane = (function () { /* CSS selectors for all of the Tor Network DOM elements we need to access */ const selectors = { - category: { - title: "label#torPreferences-labelCategory", - }, - torPreferences: { - header: "h1#torPreferences-header", - description: "span#torPreferences-description", - learnMore: "label#torPreferences-learnMore", - }, - quickstart: { - header: "h2#torPreferences-quickstart-header", - description: "span#torPreferences-quickstart-description", - enableQuickstartCheckbox: "checkbox#torPreferences-quickstart-toggle", - }, bridges: { - header: "h1#torPreferences-bridges-header", - description: "span#torPreferences-bridges-description", - learnMore: "label#torPreferences-bridges-learnMore", locationGroup: "#torPreferences-bridges-locationGroup", locationLabel: "#torPreferences-bridges-locationLabel", location: "#torPreferences-bridges-location", locationEntries: "#torPreferences-bridges-locationEntries", chooseForMe: "#torPreferences-bridges-buttonChooseBridgeForMe", }, - advanced: { - header: "h1#torPreferences-advanced-header", - label: "#torPreferences-advanced-label", - button: "#torPreferences-advanced-button", - torLogsLabel: "label#torPreferences-torLogs", - torLogsButton: "button#torPreferences-buttonTorLogs", - }, }; /* selectors */
const retval = { @@ -2342,96 +2321,62 @@ const gConnectionPane = (function () { } });
- document - .querySelector(selectors.category.title) - .setAttribute("value", TorStrings.settings.categoryTitle); - - const prefpane = document.getElementById("mainPrefPane"); - - // Heading - prefpane.querySelector(selectors.torPreferences.header).innerText = - TorStrings.settings.categoryTitle; - prefpane.querySelector(selectors.torPreferences.description).textContent = - TorStrings.settings.torPreferencesDescription; - { - const learnMore = prefpane.querySelector( - selectors.torPreferences.learnMore - ); - learnMore.setAttribute("value", TorStrings.settings.learnMore); - learnMore.setAttribute( - "href", - TorStrings.settings.learnMoreTorBrowserURL - ); - if (TorStrings.settings.learnMoreTorBrowserURL.startsWith("about:")) { - learnMore.setAttribute("useoriginprincipal", "true"); - } - } - // Internet and Tor status const internetStatus = document.getElementById( "torPreferences-status-internet" ); - internetStatus.querySelector(".torPreferences-status-name").textContent = - TorStrings.settings.statusInternetLabel; const internetResult = internetStatus.querySelector( ".torPreferences-status-result" ); const internetTest = document.getElementById( "torPreferences-status-internet-test" ); - internetTest.setAttribute( - "label", - TorStrings.settings.statusInternetTest - ); - internetTest.addEventListener("command", () => { + internetTest.addEventListener("click", () => { this.onInternetTest(); });
const torConnectStatus = document.getElementById( "torPreferences-status-tor-connect" ); - torConnectStatus.querySelector( - ".torPreferences-status-name" - ).textContent = TorStrings.settings.statusTorLabel; const torConnectResult = torConnectStatus.querySelector( ".torPreferences-status-result" ); const torConnectButton = document.getElementById( "torPreferences-status-tor-connect-button" ); - torConnectButton.setAttribute( - "label", - TorStrings.torConnect.torConnectButton - ); - torConnectButton.addEventListener("command", () => { + torConnectButton.addEventListener("click", () => { TorConnect.openTorConnect({ beginBootstrap: true }); });
this._populateStatus = () => { + let internetId; switch (this._internetStatus) { case InternetStatus.Online: internetStatus.classList.remove("offline"); - internetResult.textContent = - TorStrings.settings.statusInternetOnline; - internetResult.hidden = false; + internetId = "tor-connection-internet-status-online"; break; case InternetStatus.Offline: internetStatus.classList.add("offline"); - internetResult.textContent = - TorStrings.settings.statusInternetOffline; - internetResult.hidden = false; + internetId = "tor-connection-internet-status-offline"; break; case InternetStatus.Unknown: default: internetStatus.classList.remove("offline"); - internetResult.hidden = true; break; } + if (internetId) { + document.l10n.setAttributes(internetResult, internetId); + internetResult.hidden = false; + } else { + internetResult.hidden = true; + } + + let connectId; // FIXME: What about the TorConnectState.Disabled state? if (TorConnect.state === TorConnectState.Bootstrapped) { torConnectStatus.classList.add("connected"); torConnectStatus.classList.remove("blocked"); - torConnectResult.textContent = TorStrings.settings.statusTorConnected; + connectId = "tor-connection-network-status-connected"; // NOTE: If the button is focused when we hide it, the focus may be // lost. But we don't have an obvious place to put the focus instead. torConnectButton.hidden = true; @@ -2441,26 +2386,18 @@ const gConnectionPane = (function () { "blocked", TorConnect.potentiallyBlocked ); - torConnectResult.textContent = TorConnect.potentiallyBlocked - ? TorStrings.settings.statusTorBlocked - : TorStrings.settings.statusTorNotConnected; + connectId = TorConnect.potentiallyBlocked + ? "tor-connection-network-status-blocked" + : "tor-connection-network-status-not-connected"; torConnectButton.hidden = false; } + document.l10n.setAttributes(torConnectResult, connectId); }; this._populateStatus();
// Quickstart - prefpane.querySelector(selectors.quickstart.header).innerText = - TorStrings.settings.quickstartHeading; - prefpane.querySelector(selectors.quickstart.description).textContent = - TorStrings.settings.quickstartDescription; - - this._enableQuickstartCheckbox = prefpane.querySelector( - selectors.quickstart.enableQuickstartCheckbox - ); - this._enableQuickstartCheckbox.setAttribute( - "label", - TorStrings.settings.quickstartCheckbox + this._enableQuickstartCheckbox = document.getElementById( + "torPreferences-quickstart-toggle" ); this._enableQuickstartCheckbox.addEventListener("command", e => { const checked = this._enableQuickstartCheckbox.checked; @@ -2470,22 +2407,10 @@ const gConnectionPane = (function () { this._enableQuickstartCheckbox.checked = TorSettings.quickstart.enabled; Services.obs.addObserver(this, TorSettingsTopics.SettingsChanged);
- // Bridge setup - prefpane.querySelector(selectors.bridges.header).innerText = - TorStrings.settings.bridgesHeading; - prefpane.querySelector(selectors.bridges.description).textContent = - TorStrings.settings.bridgesDescription2; - { - const learnMore = prefpane.querySelector(selectors.bridges.learnMore); - learnMore.setAttribute("value", TorStrings.settings.learnMore); - learnMore.setAttribute("href", TorStrings.settings.learnMoreBridgesURL); - if (TorStrings.settings.learnMoreBridgesURL.startsWith("about:")) { - learnMore.setAttribute("useoriginprincipal", "true"); - } - } - // Location { + const prefpane = document.getElementById("mainPrefPane"); + const locationGroup = prefpane.querySelector( selectors.bridges.locationGroup ); @@ -2571,33 +2496,18 @@ const gConnectionPane = (function () { }
// Advanced setup - prefpane.querySelector(selectors.advanced.header).innerText = - TorStrings.settings.advancedHeading; - prefpane.querySelector(selectors.advanced.label).textContent = - TorStrings.settings.advancedLabel; - { - const settingsButton = prefpane.querySelector( - selectors.advanced.button - ); - settingsButton.setAttribute( - "label", - TorStrings.settings.advancedButton - ); - settingsButton.addEventListener("command", () => { + document + .getElementById("torPreferences-advanced-button") + .addEventListener("click", () => { this.onAdvancedSettings(); }); - }
// Tor logs - prefpane.querySelector(selectors.advanced.torLogsLabel).textContent = - TorStrings.settings.showTorDaemonLogs; - const torLogsButton = prefpane.querySelector( - selectors.advanced.torLogsButton - ); - torLogsButton.setAttribute("label", TorStrings.settings.showLogs); - torLogsButton.addEventListener("command", () => { - this.onViewTorLogs(); - }); + document + .getElementById("torPreferences-buttonTorLogs") + .addEventListener("click", () => { + this.onViewTorLogs(); + });
Services.obs.addObserver(this, TorConnectTopics.StateChange); },
===================================== browser/components/torpreferences/content/connectionPane.xhtml ===================================== @@ -11,16 +11,21 @@ data-category="paneConnection" hidden="true"
- <html:h1 id="torPreferences-header" /> + <html:h1 data-l10n-id="tor-connection-settings-heading"></html:h1> </hbox>
<groupbox data-category="paneConnection" hidden="true"> <description flex="1"> - <html:span id="torPreferences-description" class="tail-with-learn-more" /> + <html:span + data-l10n-id="tor-connection-overview" + class="tail-with-learn-more" + ></html:span> <label - id="torPreferences-learnMore" class="learnMore text-link" is="text-link" + href="about:manual#about" + useoriginprincipal="true" + data-l10n-id="tor-connection-browser-learn-more-link" /> </description> </groupbox> @@ -36,33 +41,45 @@ class="torPreferences-status-grouping" > <image class="torPreferences-status-icon" /> - <html:span class="torPreferences-status-name"></html:span> + <html:span + class="torPreferences-status-name" + data-l10n-id="tor-connection-internet-status-label" + ></html:span> <html:span class="torPreferences-status-result"></html:span> - <button id="torPreferences-status-internet-test" /> + <html:button + id="torPreferences-status-internet-test" + data-l10n-id="tor-connection-internet-status-test-button" + ></html:button> </hbox> <hbox id="torPreferences-status-tor-connect" class="torPreferences-status-grouping" > <image class="torPreferences-status-icon" /> - <html:span class="torPreferences-status-name"></html:span> + <html:span + class="torPreferences-status-name" + data-l10n-id="tor-connection-network-status-label" + ></html:span> <html:span class="torPreferences-status-result"></html:span> - <button id="torPreferences-status-tor-connect-button" /> + <html:button + id="torPreferences-status-tor-connect-button" + data-l10n-id="tor-connection-network-status-connect-button" + ></html:button> </hbox> </hbox> </groupbox>
<!-- Quickstart --> - <groupbox - id="torPreferences-quickstart-group" - data-category="paneConnection" - hidden="true" - > - <html:h2 id="torPreferences-quickstart-header" /> - <description flex="1"> - <html:span id="torPreferences-quickstart-description" /> + <groupbox data-category="paneConnection" hidden="true"> + <label> + <html:h2 data-l10n-id="tor-connection-quickstart-heading"></html:h2> + </label> + <description flex="1" data-l10n-id="tor-connection-quickstart-description"> </description> - <checkbox id="torPreferences-quickstart-toggle" /> + <checkbox + id="torPreferences-quickstart-toggle" + data-l10n-id="tor-connection-quickstart-checkbox" + /> </groupbox>
<!-- Bridges --> @@ -71,6 +88,7 @@ id="torPreferences-bridges-header" class="tor-focusable-heading" tabindex="-1" + data-l10n-id="tor-bridges-heading" ></html:h1> </hbox> <groupbox @@ -80,13 +98,15 @@
<description flex="1"> <html:span - id="torPreferences-bridges-description" class="tail-with-learn-more" + data-l10n-id="tor-bridges-overview" /> <label - id="torPreferences-bridges-learnMore" class="learnMore text-link" is="text-link" + href="about:manual#bridges" + useoriginprincipal="true" + data-l10n-id="tor-bridges-learn-more-link" /> </description> <hbox @@ -479,7 +499,7 @@
<!-- Advanced --> <hbox class="subcategory" data-category="paneConnection" hidden="true"> - <html:h1 id="torPreferences-advanced-header" /> + <html:h1 data-l10n-id="tor-advanced-settings-heading"></html:h1> </hbox> <groupbox id="torPreferences-advanced-group" @@ -487,14 +507,20 @@ hidden="true"
<hbox align="center"> - <label id="torPreferences-advanced-label" flex="1" /> - <button id="torPreferences-advanced-button" class="accessory-button" /> + <label data-l10n-id="tor-advanced-settings-description" flex="1" /> + <html:button + id="torPreferences-advanced-button" + class="accessory-button" + data-l10n-id="tor-advanced-settings-button" + ></html:button> </hbox> <hbox align="center" data-subcategory="viewlogs"> - <label id="torPreferences-torLogs" flex="1" /> - <vbox> - <button id="torPreferences-buttonTorLogs" class="accessory-button" /> - </vbox> + <label data-l10n-id="tor-view-log-description" flex="1" /> + <html:button + id="torPreferences-buttonTorLogs" + class="accessory-button" + data-l10n-id="tor-view-log-button" + ></html:button> </hbox> </groupbox> </html:template>
===================================== browser/components/torpreferences/content/connectionSettingsDialog.js ===================================== @@ -4,10 +4,6 @@ const { TorSettings, TorProxyType } = ChromeUtils.importESModule( "resource://gre/modules/TorSettings.sys.mjs" );
-const { TorStrings } = ChromeUtils.importESModule( - "resource://gre/modules/TorStrings.sys.mjs" -); - const gConnectionSettingsDialog = { _useProxyCheckbox: null, _proxyTypeLabel: null, @@ -25,7 +21,6 @@ const gConnectionSettingsDialog = { _allowedPortsTextbox: null,
selectors: { - header: "#torPreferences-connection-header", useProxyCheckbox: "checkbox#torPreferences-connection-toggleProxy", proxyTypeLabel: "label#torPreferences-localProxy-type", proxyTypeList: "menulist#torPreferences-localProxy-builtinList", @@ -53,36 +48,27 @@ const gConnectionSettingsDialog = { init() { const selectors = this.selectors;
- document.documentElement.setAttribute( - "title", - TorStrings.settings.connectionSettingsDialogTitle - ); - document.querySelector(selectors.header).textContent = - TorStrings.settings.connectionSettingsDialogHeader; - // Local Proxy this._useProxyCheckbox = document.querySelector(selectors.useProxyCheckbox); - this._useProxyCheckbox.setAttribute( - "label", - TorStrings.settings.useLocalProxy - ); this._useProxyCheckbox.addEventListener("command", e => { const checked = this._useProxyCheckbox.checked; this.onToggleProxy(checked); }); this._proxyTypeLabel = document.querySelector(selectors.proxyTypeLabel); - this._proxyTypeLabel.setAttribute("value", TorStrings.settings.proxyType);
let mockProxies = [ { value: TorProxyType.Socks4, - label: TorStrings.settings.proxyTypeSOCKS4, + l10nId: "tor-advanced-dialog-proxy-socks4-menuitem", }, { value: TorProxyType.Socks5, - label: TorStrings.settings.proxyTypeSOCKS5, + l10nId: "tor-advanced-dialog-proxy-socks5-menuitem", + }, + { + value: TorProxyType.HTTPS, + l10nId: "tor-advanced-dialog-proxy-http-menuitem", }, - { value: TorProxyType.HTTPS, label: TorStrings.settings.proxyTypeHTTP }, ]; this._proxyTypeMenulist = document.querySelector(selectors.proxyTypeList); this._proxyTypeMenulist.addEventListener("command", e => { @@ -92,24 +78,16 @@ const gConnectionSettingsDialog = { for (let currentProxy of mockProxies) { let menuEntry = window.document.createXULElement("menuitem"); menuEntry.setAttribute("value", currentProxy.value); - menuEntry.setAttribute("label", currentProxy.label); + menuEntry.setAttribute("data-l10n-id", currentProxy.l10nId); this._proxyTypeMenulist.querySelector("menupopup").appendChild(menuEntry); }
this._proxyAddressLabel = document.querySelector( selectors.proxyAddressLabel ); - this._proxyAddressLabel.setAttribute( - "value", - TorStrings.settings.proxyAddress - ); this._proxyAddressTextbox = document.querySelector( selectors.proxyAddressTextbox ); - this._proxyAddressTextbox.setAttribute( - "placeholder", - TorStrings.settings.proxyAddressPlaceholder - ); this._proxyAddressTextbox.addEventListener("blur", e => { let value = this._proxyAddressTextbox.value.trim(); let colon = value.lastIndexOf(":"); @@ -122,36 +100,19 @@ const gConnectionSettingsDialog = { } }); this._proxyPortLabel = document.querySelector(selectors.proxyPortLabel); - this._proxyPortLabel.setAttribute("value", TorStrings.settings.proxyPort); this._proxyPortTextbox = document.querySelector(selectors.proxyPortTextbox); this._proxyUsernameLabel = document.querySelector( selectors.proxyUsernameLabel ); - this._proxyUsernameLabel.setAttribute( - "value", - TorStrings.settings.proxyUsername - ); this._proxyUsernameTextbox = document.querySelector( selectors.proxyUsernameTextbox ); - this._proxyUsernameTextbox.setAttribute( - "placeholder", - TorStrings.settings.proxyUsernamePasswordPlaceholder - ); this._proxyPasswordLabel = document.querySelector( selectors.proxyPasswordLabel ); - this._proxyPasswordLabel.setAttribute( - "value", - TorStrings.settings.proxyPassword - ); this._proxyPasswordTextbox = document.querySelector( selectors.proxyPasswordTextbox ); - this._proxyPasswordTextbox.setAttribute( - "placeholder", - TorStrings.settings.proxyUsernamePasswordPlaceholder - );
this.onToggleProxy(false); if (TorSettings.proxy.enabled) { @@ -167,10 +128,6 @@ const gConnectionSettingsDialog = { this._useFirewallCheckbox = document.querySelector( selectors.useFirewallCheckbox ); - this._useFirewallCheckbox.setAttribute( - "label", - TorStrings.settings.useFirewall - ); this._useFirewallCheckbox.addEventListener("command", e => { const checked = this._useFirewallCheckbox.checked; this.onToggleFirewall(checked); @@ -178,17 +135,9 @@ const gConnectionSettingsDialog = { this._allowedPortsLabel = document.querySelector( selectors.firewallAllowedPortsLabel ); - this._allowedPortsLabel.setAttribute( - "value", - TorStrings.settings.allowedPorts - ); this._allowedPortsTextbox = document.querySelector( selectors.firewallAllowedPortsTextbox ); - this._allowedPortsTextbox.setAttribute( - "placeholder", - TorStrings.settings.allowedPortsPlaceholder - );
this.onToggleFirewall(false); if (TorSettings.firewall.enabled) {
===================================== browser/components/torpreferences/content/connectionSettingsDialog.xhtml ===================================== @@ -7,16 +7,31 @@ type="child" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" + data-l10n-id="tor-advanced-dialog-title"
<dialog id="torPreferences-connection-dialog" buttons="accept,cancel"> + <linkset> + <html:link rel="localization" href="branding/brand.ftl" /> + <html:link rel="localization" href="browser/tor-browser.ftl" /> + </linkset> + <script src="chrome://browser/content/torpreferences/connectionSettingsDialog.js" />
- <html:h3 id="torPreferences-connection-header">​</html:h3> + <html:h3 + id="torPreferences-connection-header" + data-l10n-id="tor-advanced-dialog-introduction" + ></html:h3> <!-- Local Proxy --> - <checkbox id="torPreferences-connection-toggleProxy" label="​" /> + <checkbox + id="torPreferences-connection-toggleProxy" + data-l10n-id="tor-advanced-dialog-proxy-checkbox" + /> <box id="torPreferences-connection-grid"> <hbox class="indent" align="center"> - <label id="torPreferences-localProxy-type" /> + <label + id="torPreferences-localProxy-type" + data-l10n-id="tor-advanced-dialog-proxy-type-selector-label" + /> </hbox> <hbox align="center"> <spacer flex="1" /> @@ -28,15 +43,22 @@ </menulist> </hbox> <hbox class="indent" align="center"> - <label id="torPreferences-localProxy-address" /> + <label + id="torPreferences-localProxy-address" + data-l10n-id="tor-advanced-dialog-proxy-address-input-label" + /> </hbox> <hbox align="center"> <html:input id="torPreferences-localProxy-textboxAddress" type="text" class="torMarginFix" + data-l10n-id="tor-advanced-dialog-proxy-address-input" + /> + <label + id="torPreferences-localProxy-port" + data-l10n-id="tor-advanced-dialog-proxy-port-input-label" /> - <label id="torPreferences-localProxy-port" /> <!-- proxy-port-input class style pulled from preferences.css and used in the vanilla proxy setup menu --> <html:input id="torPreferences-localProxy-textboxPort" @@ -49,27 +71,41 @@ /> </hbox> <hbox class="indent" align="center"> - <label id="torPreferences-localProxy-username" /> + <label + id="torPreferences-localProxy-username" + data-l10n-id="tor-advanced-dialog-proxy-username-input-label" + /> </hbox> <hbox align="center"> <html:input id="torPreferences-localProxy-textboxUsername" type="text" class="torMarginFix" + data-l10n-id="tor-advanced-dialog-proxy-username-input" + /> + <label + id="torPreferences-localProxy-password" + data-l10n-id="tor-advanced-dialog-proxy-password-input-label" /> - <label id="torPreferences-localProxy-password" /> <html:input id="torPreferences-localProxy-textboxPassword" class="torMarginFix" type="password" + data-l10n-id="tor-advanced-dialog-proxy-password-input" /> </hbox> </box> <!-- Firewall --> - <checkbox id="torPreferences-connection-toggleFirewall" label="​" /> + <checkbox + id="torPreferences-connection-toggleFirewall" + data-l10n-id="tor-advanced-dialog-firewall-checkbox" + /> <box id="torPreferences-connection-firewall"> <hbox class="indent" align="center"> - <label id="torPreferences-connection-allowedPorts" /> + <label + id="torPreferences-connection-allowedPorts" + data-l10n-id="tor-advanced-dialog-firewall-ports-input-label" + /> </hbox> <hbox id="torPreferences-connection-hboxAllowedPorts" align="center"> <html:input @@ -77,6 +113,7 @@ type="text" class="torMarginFix" value="80,443" + data-l10n-id="tor-advanced-dialog-firewall-ports-input" /> </hbox> </box>
===================================== browser/components/torpreferences/content/provideBridgeDialog.js ===================================== @@ -1,9 +1,5 @@ "use strict";
-const { TorStrings } = ChromeUtils.importESModule( - "resource://gre/modules/TorStrings.sys.mjs" -); - const { TorSettings, TorBridgeSource, validateBridgeLines } = ChromeUtils.importESModule("resource://gre/modules/TorSettings.sys.mjs");
@@ -191,10 +187,8 @@ const gProvideBridgeDialog = { this._result.connect = connect;
this._acceptButton.setAttribute( - "label", - connect - ? TorStrings.settings.bridgeButtonConnect - : TorStrings.settings.bridgeButtonAccept + "data-l10n-id", + connect ? "bridge-dialog-button-connect" : "bridge-dialog-button-accept" ); } },
===================================== browser/components/torpreferences/content/requestBridgeDialog.js ===================================== @@ -3,9 +3,6 @@ const { BridgeDB } = ChromeUtils.importESModule( "resource://gre/modules/BridgeDB.sys.mjs" ); -const { TorStrings } = ChromeUtils.importESModule( - "resource://gre/modules/TorStrings.sys.mjs" -);
const { TorConnect, TorConnectTopics } = ChromeUtils.importESModule( "resource://gre/modules/TorConnect.sys.mjs" @@ -20,8 +17,6 @@ const gRequestBridgeDialog = { "button#torPreferences-requestBridge-refreshCaptchaButton", incorrectCaptchaHbox: "hbox#torPreferences-requestBridge-incorrectCaptchaHbox", - incorrectCaptchaLabel: - "label#torPreferences-requestBridge-incorrectCaptchaError", },
init() { @@ -33,10 +28,6 @@ const gRequestBridgeDialog = { "torPreferences-requestBridge-dialog" );
- document.documentElement.setAttribute( - "title", - TorStrings.settings.requestBridgeDialogTitle - ); // user may have opened a Request Bridge dialog in another tab, so update the // CAPTCHA image or close out the dialog if we have a bridge list this._dialog.addEventListener("focusin", () => { @@ -59,7 +50,6 @@ const gRequestBridgeDialog = { });
this._dialogHeader = this._dialog.querySelector(selectors.dialogHeader); - this._dialogHeader.textContent = TorStrings.settings.contactingBridgeDB;
this._captchaImage = this._dialog.querySelector(selectors.captchaImage);
@@ -71,10 +61,6 @@ const gRequestBridgeDialog = { this._captchaEntryTextbox = this._dialog.querySelector( selectors.captchaEntryTextbox ); - this._captchaEntryTextbox.setAttribute( - "placeholder", - TorStrings.settings.captchaTextboxPlaceholder - ); this._captchaEntryTextbox.disabled = true; // disable submit if entry textbox is empty this._captchaEntryTextbox.oninput = () => { @@ -89,13 +75,6 @@ const gRequestBridgeDialog = { this._incorrectCaptchaHbox = this._dialog.querySelector( selectors.incorrectCaptchaHbox ); - this._incorrectCaptchaLabel = this._dialog.querySelector( - selectors.incorrectCaptchaLabel - ); - this._incorrectCaptchaLabel.setAttribute( - "value", - TorStrings.settings.incorrectCaptcha - );
Services.obs.addObserver(this, TorConnectTopics.StateChange); this.onAcceptStateChange(); @@ -111,10 +90,8 @@ const gRequestBridgeDialog = { const connect = TorConnect.canBeginBootstrap; this._result.connect = connect; this._submitButton.setAttribute( - "label", - connect - ? TorStrings.settings.bridgeButtonConnect - : TorStrings.settings.submitCaptcha + "data-l10n-id", + connect ? "bridge-dialog-button-connect" : "bridge-dialog-button-submit" ); },
@@ -129,7 +106,10 @@ const gRequestBridgeDialog = { _setcaptchaImage(uri) { if (uri != this._captchaImage.src) { this._captchaImage.src = uri; - this._dialogHeader.textContent = TorStrings.settings.solveTheCaptcha; + this._dialogHeader.setAttribute( + "data-l10n-id", + "request-bridge-dialog-top-solve" + ); this._setUIDisabled(false); this._captchaEntryTextbox.focus(); this._captchaEntryTextbox.select(); @@ -185,7 +165,10 @@ const gRequestBridgeDialog = { onRefreshCaptcha() { this._setUIDisabled(true); this._captchaImage.src = ""; - this._dialogHeader.textContent = TorStrings.settings.contactingBridgeDB; + this._dialogHeader.setAttribute( + "data-l10n-id", + "request-bridge-dialog-top-wait" + ); this._captchaEntryTextbox.value = ""; this._incorrectCaptchaHbox.style.visibility = "hidden";
===================================== browser/components/torpreferences/content/requestBridgeDialog.xhtml ===================================== @@ -7,20 +7,26 @@ type="child" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" + data-l10n-id="request-bridge-dialog-title"
<dialog id="torPreferences-requestBridge-dialog" buttons="accept,cancel"> + <linkset> + <html:link rel="localization" href="browser/tor-browser.ftl" /> + </linkset> + <script src="chrome://browser/content/torpreferences/requestBridgeDialog.js" />
- <!-- ok, so ​ is a zero-width space. We need to have *something* in the innerText so that XUL knows how tall the - title node is so that it can determine how large to make the dialog element's inner draw area. If we have nothing - in the innerText, then it collapse to 0 height, and the contents of the dialog ends up partially hidden >:( --> - <html:h3 id="torPreferences-requestBridge-header">​</html:h3> + <html:h3 + id="torPreferences-requestBridge-header" + data-l10n-id="request-bridge-dialog-top-solve" + ></html:h3> <!-- init to transparent 400x125 png --> <image id="torPreferences-requestBridge-captchaImage" flex="1" /> <hbox id="torPreferences-requestBridge-inputHbox"> <html:input id="torPreferences-requestBridge-captchaTextbox" type="text" + data-l10n-id="request-bridge-dialog-captcha-input" /> <button id="torPreferences-requestBridge-refreshCaptchaButton" @@ -30,7 +36,7 @@ </hbox> <hbox id="torPreferences-requestBridge-incorrectCaptchaHbox" align="center"> <image id="torPreferences-requestBridge-errorIcon" /> - <label id="torPreferences-requestBridge-incorrectCaptchaError" flex="1" /> + <label data-l10n-id="request-bridge-dialog-captcha-failed" flex="1" /> </hbox> </dialog> </window>
===================================== browser/components/torpreferences/content/torLogDialog.js ===================================== @@ -7,21 +7,13 @@ const { setTimeout, clearTimeout } = ChromeUtils.importESModule( const { TorProviderBuilder } = ChromeUtils.importESModule( "resource://gre/modules/TorProviderBuilder.sys.mjs" ); -const { TorStrings } = ChromeUtils.importESModule( - "resource://gre/modules/TorStrings.sys.mjs" -);
window.addEventListener( "DOMContentLoaded", () => { - document.documentElement.setAttribute( - "title", - TorStrings.settings.torLogDialogTitle - ); - const dialog = document.getElementById("torPreferences-torLog-dialog"); const copyLogButton = dialog.getButton("extra1"); - copyLogButton.setAttribute("label", TorStrings.settings.copyLog); + copyLogButton.setAttribute("data-l10n-id", "tor-log-dialog-copy-button");
const logText = document.getElementById( "torPreferences-torDialog-textarea" @@ -35,8 +27,10 @@ window.addEventListener( ); clipboard.copyString(logText.value);
- const label = copyLogButton.querySelector("label"); - label.setAttribute("value", TorStrings.settings.copied); + copyLogButton.setAttribute( + "data-l10n-id", + "tor-log-dialog-copy-button-copied" + ); copyLogButton.classList.add("primary");
const RESTORE_TIME = 1200; @@ -44,7 +38,10 @@ window.addEventListener( clearTimeout(restoreButtonTimeout); } restoreButtonTimeout = setTimeout(() => { - label.setAttribute("value", TorStrings.settings.copyLog); + copyLogButton.setAttribute( + "data-l10n-id", + "tor-log-dialog-copy-button" + ); copyLogButton.classList.remove("primary"); restoreButtonTimeout = null; }, RESTORE_TIME);
===================================== browser/components/torpreferences/content/torLogDialog.xhtml ===================================== @@ -7,8 +7,13 @@ type="child" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" + data-l10n-id="tor-log-dialog-title"
<dialog id="torPreferences-torLog-dialog" buttons="accept,extra1"> + <linkset> + <html:link rel="localization" href="browser/tor-browser.ftl" /> + </linkset> + <script src="chrome://browser/content/torpreferences/torLogDialog.js" />
<html:textarea
===================================== browser/components/torpreferences/content/torPreferences.css ===================================== @@ -1023,6 +1023,11 @@ groupbox#torPreferences-bridges-group textarea { }
/* Connection settings dialog */ +#torPreferences-connection-dialog label { + /* Do not wrap the labels. */ + white-space: nowrap; +} + #torPreferences-connection-header { margin: 4px 0 14px 0; }
===================================== browser/locales/en-US/browser/tor-browser.ftl ===================================== @@ -45,7 +45,55 @@ tor-browser-home-message-testing = This is an unstable version of Tor Browser fo home-mode-choice-tor = .label = Tor Browser Home
-## Tor Bridges Settings +## Tor connection settings. + +# "Connection" refers to the Tor Browser's connection to the Tor network. +tor-connection-settings-heading = Connection +# -brand-short-name refers to 'Tor Browser', localized. +tor-connection-overview = { -brand-short-name } routes your traffic over the Tor Network, run by thousands of volunteers around the world. +tor-connection-browser-learn-more-link = Learn more +tor-connection-quickstart-heading = Quickstart +# -brand-short-name refers to 'Tor Browser', localized. +tor-connection-quickstart-description = Quickstart connects { -brand-short-name } to the Tor Network automatically when launched, based on your last used connection settings. +tor-connection-quickstart-checkbox = + .label = Always connect automatically + +# Prefix before the internet connection status. +# "Internet" is not a proper noun, but is capitalized because it is the start of a sentence. +tor-connection-internet-status-label = Internet: +# Button to test the internet connection. +# Here "Test" is a verb, as in "test the internet connection". +# Uses sentence case in English (US). +tor-connection-internet-status-test-button = Test +# Shown when the user is connected to the internet. +# Uses sentence case in English (US). +tor-connection-internet-status-online = Online +# Shown when the user is not connected to the internet. +# Uses sentence case in English (US). +tor-connection-internet-status-offline = Offline + +# Prefix before the Tor network connection status. +# Uses sentence case in English (US). +tor-connection-network-status-label = Tor network: +# Shown when the user is connected to the Tor network. +# Uses sentence case in English (US). +tor-connection-network-status-connected = Connected +# Shown when the user is not connected to the Tor network. +# Uses sentence case in English (US). +tor-connection-network-status-not-connected = Not connected +# Shown when the user's Tor connection may be blocked. +# Uses sentence case in English (US). +tor-connection-network-status-blocked = Potentially blocked +# Button shown when we are not yet connected to the Tor network. +# It will open a page to start connecting to the Tor network. +# Uses sentence case in English (US). +tor-connection-network-status-connect-button = Connect + +## Tor Bridges Settings. + +tor-bridges-heading = Bridges +tor-bridges-overview = Bridges help you securely access the Tor Network in places where Tor is blocked. Depending on where you are, one bridge may work better than another. +tor-bridges-learn-more-link = Learn more
# Toggle button for enabling and disabling the use of bridges. tor-bridges-use-bridges = @@ -78,6 +126,16 @@ tor-bridges-menu-item-remove-all-bridges = Remove all bridges
# Shown when one of the built-in bridges is in use. tor-bridges-built-in-status-connected = Connected +# "obfs4" is a technical name, and likely should not be translated. +tor-bridges-built-in-obfs4-name = obfs4 +tor-bridges-built-in-obfs4-description = Makes your Tor traffic look like random data. May not work in heavily censored regions. +# "Snowflake" is a proper noun for a type of Tor bridge, and likely should not be translated. +tor-bridges-built-in-snowflake-name = Snowflake +# "Snowflake" is a proper noun for a type of Tor bridge, and likely should not be translated. +tor-bridges-built-in-snowflake-description = Routes your connection through Snowflake proxies to make it look like you’re placing a video call, for example. +# "meek-azure" is a technical name, and likely should not be translated. +tor-bridges-built-in-meek-azure-name = meek-azure +tor-bridges-built-in-meek-azure-description = Makes it look like you’re connected to a Microsoft website, instead of using Tor. May work in heavily censored regions, but is usually very slow.
# Shown at the start of a Tor bridge line. # $type (String) - The Tor bridge type ("snowflake", "obfs4", "meek-azure"). @@ -195,6 +253,7 @@ tor-bridges-add-bridges-heading = Add bridges # Shown as a heading when the user has existing bridges that can be replaced. tor-bridges-replace-bridges-heading = Replace your bridges
+# -brand-short-name refers to 'Tor Browser', localized. tor-bridges-select-built-in-description = Choose from one of { -brand-short-name }’s built-in bridges tor-bridges-select-built-in-button = Select a built-in bridge…
@@ -233,6 +292,23 @@ tor-bridges-provider-email-instruction = Email { $address } tor-bridges-request-from-browser = You can also get bridges from the bridge bot without leaving { -brand-short-name }. tor-bridges-request-button = Request bridges…
+## Warning dialog when removing all bridges. + +remove-all-bridges-warning-title = Remove all bridges? +remove-all-bridges-warning-description = If these bridges were received from torproject.org or added manually, this action cannot be undone +remove-all-bridges-warning-remove-button = Remove + +## Bridge QR code dialog. + +bridge-qr-dialog-title = + .title = Scan the QR code + +## Common button used in bridge dialogs. + +bridge-dialog-button-connect = Connect +bridge-dialog-button-accept = OK +bridge-dialog-button-submit = Submit + ## User provided bridge dialog.
# Used when the user is editing their existing bridge addresses. @@ -300,11 +376,92 @@ user-provide-bridge-dialog-next-button =
## Built-in bridges dialog.
+built-in-dialog-title = + .title = Select a Built-In Bridge +# -brand-short-name refers to 'Tor Browser', localized. +built-in-dialog-introduction = { -brand-short-name } includes some specific types of bridges known as “pluggable transports”, which can help conceal the fact you’re using Tor. +# "obfs4" is a technical name, and likely should not be translated. +built-in-dialog-obfs4-radio-option = + .label = obfs4 +# "Snowflake" is a proper noun for a type of Tor bridge, and likely should not be translated. +built-in-dialog-snowflake-radio-option = + .label = Snowflake +# "meek-azure" is a technical name, and likely should not be translated. +built-in-dialog-meek-azure-radio-option = + .label = meek-azure # Label attached to the built-in bridge option that is already in use. # The "aria-label" should use the same text, but include some ending punctuation to separate it from the sentence that follows. This is used for screen reader users. built-in-dialog-current-bridge-label = Current bridge .aria-label = Current bridge.
+request-bridge-dialog-title = + .title = Request Bridge +request-bridge-dialog-top-wait = Contacting BridgeDB. Please Wait. +request-bridge-dialog-top-solve = Solve the CAPTCHA to request a bridge. +request-bridge-dialog-captcha-input = + .placeholder = Enter the characters from the image +request-bridge-dialog-captcha-failed = The solution is not correct. Please try again. + +## Tor advanced settings. + +tor-advanced-settings-heading = Advanced +tor-advanced-settings-description = Configure how { -brand-short-name } connects to the internet. +# Button that opens the advanced connection settings dialog. +# Uses sentence case in English (US). +tor-advanced-settings-button = Settings… +# "log" is a noun, referring to the recorded text output of the Tor process. +tor-view-log-description = View the Tor log. +# "log" is a noun, referring to the recorded text output of the Tor process. +# Uses sentence case in English (US). +tor-view-log-button = View log… + +## Tor log dialog. + +# "log" is a noun, referring to the recorded text output of the Tor process. +tor-log-dialog-title = + .title = Tor log +# "log" is a noun, referring to the recorded text output of the Tor process. +tor-log-dialog-copy-button = + .label = Copy Tor log to clipboard +# Button text changes for a short time after activating the button. +tor-log-dialog-copy-button-copied = + .label = Copied! + +## Tor advanced connection settings dialog. + +tor-advanced-dialog-title = + .title = Connection settings +tor-advanced-dialog-introduction = Configure how { -brand-short-name } connects to the internet. +tor-advanced-dialog-proxy-checkbox = + .label = I use a proxy to connect to the internet +tor-advanced-dialog-proxy-type-selector-label = Proxy type +# SOCKS4 is a technical name, and should likely not be translated. +tor-advanced-dialog-proxy-socks4-menuitem = + .label = SOCKS4 +# SOCKS5 is a technical name, and should likely not be translated. +tor-advanced-dialog-proxy-socks5-menuitem = + .label = SOCKS5 +# HTTP and HTTPS are technical names, and should likely not be translated. +# The "/" refers to "HTTP or HTTPS" and can be translated. +tor-advanced-dialog-proxy-http-menuitem = + .label = HTTP/HTTPS +# "address" is a noun, referring to an network IP address. +tor-advanced-dialog-proxy-address-input-label = Address +tor-advanced-dialog-proxy-address-input = + .placeholder = IP address or hostname +tor-advanced-dialog-proxy-port-input-label = Port +tor-advanced-dialog-proxy-username-input-label = Username +tor-advanced-dialog-proxy-username-input = + .placeholder = Optional +tor-advanced-dialog-proxy-password-input-label = Password +tor-advanced-dialog-proxy-password-input = + .placeholder = Optional +tor-advanced-dialog-firewall-checkbox = + .label = This computer goes through a firewall that only allows connections to certain ports +tor-advanced-dialog-firewall-ports-input-label = Allowed ports +tor-advanced-dialog-firewall-ports-input = + .placeholder = Comma-separated values + ## About Tor Browser dialog.
# '<label data-l10n-name="project-link">' and '</label>' should wrap the link text for the Tor Project, and will link to the Tor Project web page.
===================================== toolkit/modules/TorStrings.sys.mjs ===================================== @@ -67,107 +67,23 @@ const Loader = { */ settings() { const strings = { - categoryTitle: "Connection", // Message box torPreferencesDescription: "Tor Browser routes your traffic over the Tor Network, run by thousands of volunteers around the world.", - // Status - statusInternetLabel: "Internet:", - statusInternetTest: "Test", - statusInternetOnline: "Online", - statusInternetOffline: "Offline", - statusTorLabel: "Tor Network:", - statusTorConnected: "Connected", - statusTorNotConnected: "Not Connected", - statusTorBlocked: "Potentially Blocked", - learnMore: "Learn more", // Quickstart - quickstartHeading: "Quickstart", - quickstartDescription: - "Quickstart connects Tor Browser to the Tor Network automatically when launched, based on your last used connection settings.", quickstartCheckbox: "Always connect automatically", - // Bridge settings - bridgesHeading: "Bridges", - bridgesDescription2: - "Bridges help you securely access the Tor Network in places where Tor is blocked. Depending on where you are, one bridge may work better than another.", bridgeLocation: "Your location", bridgeLocationAutomatic: "Automatic", bridgeLocationFrequent: "Frequently selected locations", bridgeLocationOther: "Other locations", bridgeChooseForMe: "Choose a Bridge For Me…", - remove: "Remove", - bridgeDisableBuiltIn: "Disable built-in bridges", - copied: "Copied!", - bridgeRemoveAllDialogTitle: "Remove all bridges?", - bridgeRemoveAllDialogDescription: - "If these bridges were received from torproject.org or added manually, this action cannot be undone", - // Advanced settings - advancedHeading: "Advanced", - advancedLabel: "Configure how Tor Browser connects to the internet", - advancedButton: "Settings…", - showTorDaemonLogs: "View the Tor logs", - showLogs: "View Logs…", - // Remove all bridges dialog - removeBridgesQuestion: "Remove all the bridges?", - removeBridgesWarning: "This action cannot be undone.", - cancel: "Cancel", - // Scan bridge QR dialog - scanQrTitle: "Scan the QR code", - // Builtin bridges dialog - builtinBridgeHeader: "Select a Built-In Bridge", - builtinBridgeDescription2: - "Tor Browser includes some specific types of bridges known as “pluggable transports”, which can help conceal the fact you’re using Tor.", - builtinBridgeObfs4Title: "obfs4 (Built-in)", - builtinBridgeObfs4Description2: - "Makes your Tor traffic look like random data. May not work in heavily censored regions.", - builtinBridgeSnowflake: "Snowflake", - builtinBridgeSnowflakeDescription2: - "Routes your connection through Snowflake proxies to make it look like you’re placing a video call, for example.", - builtinBridgeMeekAzure: "meek-azure", - builtinBridgeMeekAzureDescription2: - "Makes it look like you’re connected to a Microsoft website, instead of using Tor. May work in heavily censored regions, but is usually very slow.", - bridgeButtonConnect: "Connect", - bridgeButtonAccept: "OK", - // Request bridges dialog - requestBridgeDialogTitle: "Request Bridge", - submitCaptcha: "Submit", - contactingBridgeDB: "Contacting BridgeDB. Please Wait.", - solveTheCaptcha: "Solve the CAPTCHA to request a bridge.", - captchaTextboxPlaceholder: "Enter the characters from the image", - incorrectCaptcha: "The solution is not correct. Please try again.", - // Connection settings dialog - connectionSettingsDialogTitle: "Connection Settings", - connectionSettingsDialogHeader: - "Configure how Tor Browser connects to the Internet", - useLocalProxy: "I use a proxy to connect to the Internet", - proxyType: "Proxy Type", - proxyTypeSOCKS4: "SOCKS4", - proxyTypeSOCKS5: "SOCKS5", - proxyTypeHTTP: "HTTP/HTTPS", - proxyAddress: "Address", - proxyAddressPlaceholder: "IP address or hostname", - proxyPort: "Port", - proxyUsername: "Username", - proxyPassword: "Password", - proxyUsernamePasswordPlaceholder: "Optional", - useFirewall: - "This computer goes through a firewall that only allows connections to certain ports", - allowedPorts: "Allowed Ports", - allowedPortsPlaceholder: "Comma-seperated values", - // Log dialog - torLogDialogTitle: "Tor Logs", - copyLog: "Copy Tor Log to Clipboard", };
const tsb = new TorPropertyStringBundle( "chrome://torbutton/locale/settings.properties", "settings." ); - return { - ...tsb.getStrings(strings), - learnMoreTorBrowserURL: "about:manual#about", - learnMoreBridgesURL: "about:manual#bridges", - }; + return tsb.getStrings(strings); } /* Tor Network Settings Strings */,
torConnect() {
===================================== toolkit/torbutton/chrome/locale/en-US/settings.properties ===================================== @@ -3,95 +3,17 @@ # 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/.
-settings.categoryTitle=Connection +# Still used in TorConnect.
# Message box settings.torPreferencesDescription=Tor Browser routes your traffic over the Tor Network, run by thousands of volunteers around the world.
-# Status -settings.statusInternetLabel=Internet: -settings.statusInternetTest=Test -settings.statusInternetOnline=Online -settings.statusInternetOffline=Offline -settings.statusTorLabel=Tor Network: -settings.statusTorConnected=Connected -settings.statusTorNotConnected=Not Connected -settings.statusTorBlocked=Potentially Blocked -settings.learnMore=Learn more - -# Quickstart -settings.quickstartHeading=Quickstart -settings.quickstartDescription=Quickstart connects Tor Browser to the Tor Network automatically when launched, based on your last used connection settings. settings.quickstartCheckbox=Always connect automatically
-# Bridge settings -settings.bridgesHeading=Bridges -settings.bridgesDescription2=Bridges help you securely access the Tor Network in places where Tor is blocked. Depending on where you are, one bridge may work better than another. +# Might be removed in tor-browser#42477 + settings.bridgeLocation=Your location settings.bridgeLocationAutomatic=Automatic settings.bridgeLocationFrequent=Frequently selected locations settings.bridgeLocationOther=Other locations settings.bridgeChooseForMe=Choose a Bridge For Me… - -settings.remove=Remove -settings.bridgeDisableBuiltIn=Disable built-in bridges -settings.copied=Copied! -settings.bridgeRemoveAllDialogTitle=Remove all bridges? -settings.bridgeRemoveAllDialogDescription=If these bridges were received from torproject.org or added manually, this action cannot be undone - -# Advanced settings -settings.advancedHeading=Advanced -settings.advancedLabel=Configure how Tor Browser connects to the internet -settings.advancedButton=Settings… -settings.showTorDaemonLogs=View the Tor logs -settings.showLogs=View Logs… - -# Remove all bridges dialog -settings.removeBridgesQuestion=Remove all the bridges? -settings.removeBridgesWarning=This action cannot be undone. -settings.cancel=Cancel - -# Scan bridge QR dialog -settings.scanQrTitle=Scan the QR code - -# Builtin bridges dialog -settings.builtinBridgeHeader=Select a Built-In Bridge -settings.builtinBridgeDescription2=Tor Browser includes some specific types of bridges known as “pluggable transports”, which can help conceal the fact you’re using Tor. -settings.builtinBridgeObfs4Title=obfs4 (Built-in) -settings.builtinBridgeObfs4Description2=Makes your Tor traffic look like random data. May not work in heavily censored regions. -settings.builtinBridgeSnowflake=Snowflake -settings.builtinBridgeSnowflakeDescription2=Routes your connection through Snowflake proxies to make it look like you’re placing a video call, for example. -settings.builtinBridgeMeekAzure=meek-azure -settings.builtinBridgeMeekAzureDescription2=Makes it look like you’re connected to a Microsoft website, instead of using Tor. May work in heavily censored regions, but is usually very slow. -settings.bridgeButtonConnect=Connect -settings.bridgeButtonAccept=OK - -# Request bridges dialog -settings.requestBridgeDialogTitle=Request Bridge -settings.submitCaptcha=Submit -settings.contactingBridgeDB=Contacting BridgeDB. Please Wait. -settings.solveTheCaptcha=Solve the CAPTCHA to request a bridge. -settings.captchaTextboxPlaceholder=Enter the characters from the image -settings.incorrectCaptcha=The solution is not correct. Please try again. - -# Connection settings dialog -settings.connectionSettingsDialogTitle=Connection Settings -settings.connectionSettingsDialogHeader=Configure how Tor Browser connects to the Internet -settings.useLocalProxy=I use a proxy to connect to the Internet -settings.proxyType=Proxy Type -settings.proxyTypeSOCKS4=SOCKS4 -settings.proxyTypeSOCKS5=SOCKS5 -settings.proxyTypeHTTP=HTTP/HTTPS -settings.proxyAddress=Address -settings.proxyAddressPlaceholder=IP address or hostname -settings.proxyPort=Port -settings.proxyUsername=Username -settings.proxyPassword=Password -settings.proxyUsernamePasswordPlaceholder=Optional -settings.useFirewall=This computer goes through a firewall that only allows connections to certain ports -settings.allowedPorts=Allowed Ports -settings.allowedPortsPlaceholder=Comma-separated values - -# Log dialog -settings.torLogDialogTitle=Tor Logs -settings.copyLog=Copy Tor Log to Clipboard
===================================== tools/torbrowser/l10n/migrations/bug-42207-settings.py ===================================== @@ -0,0 +1,88 @@ +from fluent.migrate.helpers import transforms_from + + +def migrate(ctx): + legacy_path = "settings.properties" + ctx.add_transforms( + "tor-browser.ftl", + "tor-browser.ftl", + transforms_from( + """ +tor-connection-settings-heading = { COPY(path, "settings.categoryTitle") } +tor-connection-browser-learn-more-link = { COPY(path, "settings.learnMore") } + +tor-connection-quickstart-heading = { COPY(path, "settings.quickstartHeading") } +tor-connection-quickstart-checkbox = + .label = { COPY(path, "settings.quickstartCheckbox") } + +tor-connection-internet-status-label = { COPY(path, "settings.statusInternetLabel") } +tor-connection-internet-status-test-button = { COPY(path, "settings.statusInternetTest") } +tor-connection-internet-status-online = { COPY(path, "settings.statusInternetOnline") } +tor-connection-internet-status-offline = { COPY(path, "settings.statusInternetOffline") } + +tor-bridges-heading = { COPY(path, "settings.bridgesHeading") } +tor-bridges-overview = { COPY(path, "settings.bridgesDescription2") } +tor-bridges-learn-more-link = { COPY(path, "settings.learnMore") } + +tor-bridges-built-in-obfs4-description = { COPY(path, "settings.builtinBridgeObfs4Description2") } +tor-bridges-built-in-snowflake-name = { COPY(path, "settings.builtinBridgeSnowflake") } +tor-bridges-built-in-snowflake-description = { COPY(path, "settings.builtinBridgeSnowflakeDescription2") } +tor-bridges-built-in-meek-azure-name = { COPY(path, "settings.builtinBridgeMeekAzure") } +tor-bridges-built-in-meek-azure-description = { COPY(path, "settings.builtinBridgeMeekAzureDescription2") } + +remove-all-bridges-warning-title = { COPY(path, "settings.bridgeRemoveAllDialogTitle") } +remove-all-bridges-warning-description = { COPY(path, "settings.bridgeRemoveAllDialogDescription") } +remove-all-bridges-warning-remove-button = { COPY(path, "settings.remove") } + +bridge-qr-dialog-title = + .title = { COPY(path, "settings.scanQrTitle") } + +bridge-dialog-button-connect = { COPY(path, "settings.bridgeButtonConnect") } +bridge-dialog-button-accept = { COPY(path, "settings.bridgeButtonAccept") } +bridge-dialog-button-submit = { COPY(path, "settings.submitCaptcha") } + +built-in-dialog-title = + .title = { COPY(path, "settings.builtinBridgeHeader") } +built-in-dialog-snowflake-radio-option = + .label = { COPY(path, "settings.builtinBridgeSnowflake") } +built-in-dialog-meek-azure-radio-option = + .label = { COPY(path, "settings.builtinBridgeMeekAzure") } + +request-bridge-dialog-title = + .title = { COPY(path, "settings.requestBridgeDialogTitle") } +request-bridge-dialog-top-wait = { COPY(path, "settings.contactingBridgeDB") } +request-bridge-dialog-top-solve = { COPY(path, "settings.solveTheCaptcha") } +request-bridge-dialog-captcha-input = + .placeholder = { COPY(path, "settings.captchaTextboxPlaceholder") } +request-bridge-dialog-captcha-failed = { COPY(path, "settings.incorrectCaptcha") } + +tor-advanced-settings-heading = { COPY(path, "settings.advancedHeading") } +tor-advanced-settings-button = { COPY(path, "settings.advancedButton") } + +tor-log-dialog-copy-button-copied = + .label = { COPY(path, "settings.copied") } + +tor-advanced-dialog-proxy-socks4-menuitem = + .label = { COPY(path, "settings.proxyTypeSOCKS4") } +tor-advanced-dialog-proxy-socks5-menuitem = + .label = { COPY(path, "settings.proxyTypeSOCKS5") } +tor-advanced-dialog-proxy-http-menuitem = + .label = { COPY(path, "settings.proxyTypeHTTP") } +tor-advanced-dialog-proxy-address-input-label = { COPY(path, "settings.proxyAddress") } +tor-advanced-dialog-proxy-address-input = + .placeholder = { COPY(path, "settings.proxyAddressPlaceholder") } +tor-advanced-dialog-proxy-port-input-label = { COPY(path, "settings.proxyPort") } +tor-advanced-dialog-proxy-username-input-label = { COPY(path, "settings.proxyUsername") } +tor-advanced-dialog-proxy-username-input = + .placeholder = { COPY(path, "settings.proxyUsernamePasswordPlaceholder") } +tor-advanced-dialog-proxy-password-input-label = { COPY(path, "settings.proxyPassword") } +tor-advanced-dialog-proxy-password-input = + .placeholder = { COPY(path, "settings.proxyUsernamePasswordPlaceholder") } +tor-advanced-dialog-firewall-checkbox = + .label = { COPY(path, "settings.useFirewall") } +tor-advanced-dialog-firewall-ports-input = + .placeholder = { COPY(path, "settings.allowedPortsPlaceholder") } +""", + path=legacy_path, + ), + )
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/3f77b1f...
tor-commits@lists.torproject.org