Commit f46990b1 authored by Arthur Edelstein's avatar Arthur Edelstein
Browse files

Bug 21574.2: Generate manual link dynamically

parent bd579aa4
......@@ -23,10 +23,15 @@
href="chrome://torbutton/skin/aboutTor.css"/>
<script type="text/javascript;version=1.7">
<![CDATA[
Components.utils.import("resource://gre/modules/Services.jsm");
function onLoad()
{
insertPropertyStrings();
let locale = Services.prefs.getCharPref("general.useragent.locale");
document.getElementById("manualLink").href = "https://tb-manual.torproject.org/" + locale;
document.addEventListener("AboutTorAdjustArrow", function() {
adjustToolbarIconArrow();
}, false);
......@@ -141,7 +146,6 @@ function insertPropertyStrings()
try {
let kPropertiesURL = "chrome://torbutton/locale/aboutTor.properties";
Components.utils.import("resource://gre/modules/Services.jsm");
let gStringBundle = Services.strings.createBundle(kPropertiesURL);
let s1 = gStringBundle.GetStringFromName("aboutTor.searchDDG.privacy.link");
let s2 = gStringBundle.GetStringFromName("aboutTor.searchDDG.search.link");
......@@ -222,7 +226,7 @@ window.addEventListener("pageshow", function() {
</a>
</li>
<li class="showForManual">
<a href="&aboutTor.torbrowser_user_manual.link;">
<a id="manualLink">
&aboutTor.torbrowser_user_manual.label; &raquo;
</a>
</li>
......
......@@ -22,6 +22,6 @@
position="1"
label="&aboutTor.torbrowser_user_manual.label;"
accesskey="&aboutTor.torbrowser_user_manual.accesskey;"
oncommand="gBrowser.selectedTab = gBrowser.addTab('&aboutTor.torbrowser_user_manual.link;')" />
oncommand="gBrowser.selectedTab = gBrowser.addTab('https://tb-manual.torproject.org/' + Services.prefs.getCharPref('general.useragent.locale'))" />
</menupopup>
</overlay>
......@@ -31,7 +31,6 @@
<!ENTITY aboutTor.whatnext.link "https://www.torproject.org/download/download.html.en#warning">
<!ENTITY aboutTor.torbrowser_user_manual.accesskey "M">
<!ENTITY aboutTor.torbrowser_user_manual.label "Tor Browser User Manual">
<!ENTITY aboutTor.torbrowser_user_manual.link "https://tb-manual.torproject.org/en-US">
<!ENTITY aboutTor.helpInfo1.label "You Can Help!">
<!ENTITY aboutTor.helpInfo2.label "There are many ways you can help make the Tor Network faster and stronger:">
<!ENTITY aboutTor.helpInfo3.label "Run a Tor Relay Node »">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment