Ticket #13881: 0001-Bug-13881.-Localize-strings-for-tor-circuit-display.patch

File 0001-Bug-13881.-Localize-strings-for-tor-circuit-display.patch, 4.3 KB (added by arthuredelstein, 5 years ago)
  • src/chrome/content/popup.xul

    From d434821fcdd6ef0b6e66bb53466d15dac1504e2a Mon Sep 17 00:00:00 2001
    From: Arthur Edelstein <arthuredelstein@gmail.com>
    Date: Fri, 5 Dec 2014 16:08:21 -0800
    Subject: [PATCH] Bug #13881. Localize strings for tor circuit display
    
    ---
     src/chrome/content/popup.xul              |  2 +-
     src/chrome/content/tor-circuit-display.js | 20 ++++++++++++++++----
     src/chrome/locale/en/torbutton.dtd        |  1 +
     src/chrome/locale/en/torbutton.properties |  5 +++++
     4 files changed, 23 insertions(+), 5 deletions(-)
    
    diff --git a/src/chrome/content/popup.xul b/src/chrome/content/popup.xul
    index 2965ec5..5f12f2b 100644
    a b  
    5151         <svg xmlns="http://www.w3.org/2000/svg" version="1.1" baseProfile="full"
    5252              width="290" height="140" id="tor-circuit" style="display:none;">
    5353              <rect x="0" y="0" width="100%" height="100%" fill="#e8f4f4" />
    54               <text id="title" style="font-size:14px;font-weight:bold;" x="10" y="20" fill="#2c26a7">Tor circuit for this site</text>
     54              <text id="title" style="font-size:14px;font-weight:bold;" x="10" y="20" fill="#2c26a7">&torbutton.circuit_display.title;</text>
    5555              <text id="domain" style="font-size:13px;" x="10" y="38" fill="black">(trac.torproject.org):</text>
    5656              <rect x="18.5" width="3" y="56" height="64" fill="#4d363a" stroke-width="0"/>
    5757              <circle class="node-circle" cx="20" cy="56" r="4" />
  • src/chrome/content/tor-circuit-display.js

    diff --git a/src/chrome/content/tor-circuit-display.js b/src/chrome/content/tor-circuit-display.js
    index 4c31bc6..39225b6 100644
    a b let collectIsolationData = function (aController) { 
    151151
    152152// ## User interface
    153153
     154// __torbuttonBundle__.
     155// Bundle of localized strings for torbutton UI.
     156let torbuttonBundle = Services.strings.createBundle(
     157                        "chrome://torbutton/locale/torbutton.properties");
     158
     159// __uiString__.
     160// Read the localized strings for this UI.
     161let uiString = function (shortName) {
     162  return torbuttonBundle.GetStringFromName("torbutton.circuit_display." + shortName);
     163};
     164
    154165// __regionBundle__.
    155166// A list of localized region (country) names.
    156167let regionBundle = Services.strings.createBundle(
    let showCircuitDisplay = function (show) { 
    181192// and converts each node data to text, as
    182193// `"France (12.34.56.78)"`.
    183194let nodeLines = function (nodeData) {
    184   let result = ["This browser"];
     195  let result = [uiString("this_browser")];
    185196  for (let {ip, countryCode, type} of nodeData) {
    186197    let bridge = type === "bridge";
    187198    result.push((countryCode ? localizedCountryNameFromCode(countryCode)
    188                              : "Unknown country") +
    189                 " (" + (bridge ? "Bridge" : (ip || "IP unknown")) + ")");
     199                             : uiString("unknown_country")) +
     200                " (" + (bridge ? uiString("tor_bridge")
     201                               : (ip || uiString("ip_unknown"))) + ")");
    190202  }
    191   result[4] = "Internet";
     203  result[4] = uiString("internet");
    192204  return result;
    193205};
    194206
  • src/chrome/locale/en/torbutton.dtd

    diff --git a/src/chrome/locale/en/torbutton.dtd b/src/chrome/locale/en/torbutton.dtd
    index 283032b..72c7d41 100644
    a b  
    155155<!ENTITY torbutton.prefs.sec_med_high "Medium-High">
    156156<!ENTITY torbutton.prefs.sec_high "High">
    157157<!ENTITY torbutton.prefs.sec_custom "Custom Values">
     158<!ENTITY torbutton.circuit_display.title "Tor circuit for this site">
  • src/chrome/locale/en/torbutton.properties

    diff --git a/src/chrome/locale/en/torbutton.properties b/src/chrome/locale/en/torbutton.properties
    index c76be32..c3e85a3 100644
    a b  
    11torbutton.button.tooltip.disabled = Enable Tor
    22torbutton.button.tooltip.enabled = Disable Tor
     3torbutton.circuit_display.internet = Internet
     4torbutton.circuit_display.ip_unknown = IP unknown
     5torbutton.circuit_display.this_browser = This browser
     6torbutton.circuit_display.tor_bridge = Bridge
     7torbutton.circuit_display.unknown_country = Unknown country
    38torbutton.panel.tooltip.disabled = Click to enable Tor
    49torbutton.panel.tooltip.enabled = Click to disable Tor
    510torbutton.panel.plugins.disabled = Click to enable plugins