[Pkg-privacy-commits] [xul-ext-monkeysphere] 250/296: overhaul locales handling
Ximin Luo
infinity0 at moszumanska.debian.org
Mon Aug 24 07:39:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository xul-ext-monkeysphere.
commit 32c459666ebb8dd52fbe19d4beec0afe30a90f5a
Author: Julien Moutinho <julm at savines.alpes.fr.eu.org>
Date: Tue Dec 14 13:50:57 2010 +0100
overhaul locales handling
SEE: https://developer.mozilla.org/en/Localizing_an_extension
SEE: http://www-archive.mozilla.org/projects/l10n/mlp_chrome.html
SEE: http://babelwiki.babelzilla.org/index.php?title=Main_Page&Itemid=258
NOTE: Gecko <1.9 (Firefox 3) not handled,
since install.rdf has <em:minVersion>3.5
SEE: https://developer.mozilla.org/en/Localizing_extension_descriptions#Localizing_before_Gecko_1.9
NOTE: maybe a few contents.rdf should be written
NOTE: not clear to me whether locale/xx-XX/ is ok
or if we should rather use: locale/monkeysphere/xx-XX/
or: locale/xx-XX/monkeysphere/
---
.../{locale/en-US/help.html => content/help.xhtml} | 27 ++++++++------
chrome/content/monkeysphere.js | 43 +++++++++++++++-------
chrome/content/monkeysphere.xul | 14 ++-----
chrome/locale/en-US/help.dtd | 16 ++++++++
chrome/locale/en-US/messages | 5 +++
chrome/locale/en-US/messages.dtd | 6 +++
6 files changed, 76 insertions(+), 35 deletions(-)
diff --git a/chrome/locale/en-US/help.html b/chrome/content/help.xhtml
similarity index 51%
rename from chrome/locale/en-US/help.html
rename to chrome/content/help.xhtml
index 51d2428..bf7788d 100644
--- a/chrome/locale/en-US/help.html
+++ b/chrome/content/help.xhtml
@@ -1,9 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" [
+ <!ENTITY % quot """> <!-- quotation mark, U+0022 ISOnum -->
+ <!ENTITY % amp "&"> <!-- ampersand, U+0026 ISOnum -->
+ <!ENTITY % lt "<"> <!-- less-than sign, U+003C ISOnum -->
+ <!ENTITY % gt ">"> <!-- greater-than sign, U+003E ISOnum -->
+ <!ENTITY % apos "'"> <!-- apostrophe = APL quote, U+0027 ISOnum -->
+ <!ENTITY % helpDTD SYSTEM "chrome://monkeysphere/locale/help.dtd">
+ %helpDTD;
+ ]>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<title>The Monkeysphere Project - Mozilla/Firefox/Iceweasel XUL Extension</title>
+<title>&help.title;</title>
<link rel="stylesheet" href="chrome://monkeysphere/content/local.css" type="text/css" />
</head><body>
@@ -30,19 +39,15 @@
<div id="content">
- <h1>The Monkeysphere Project XUL Extension</h1>
+ <h1>&help.project.title;</h1>
- <p>The Monkeysphere project's goal is to extend OpenPGP's web of
- trust to new areas of the Internet to help us securely identify each
- other while we work online.</p>
+ <p>&help.project.goal;</p>
- <p>This Mozilla/Firefox/Iceweasel XUL extension, along with a
- Monkeysphere validation agent, will allow you to validate https web
- sites that have been put on the OpenPGP web of trust.</p>
+ <p>&help.project.mozilla-extension;</p>
- <h2>Further Information</h2>
+ <h2>&help.further-information.title;</h2>
- For further information, see <a href="http://monkeysphere.info/">monkeysphere.info</a>.
+ &help.further-information.see;
</div>
diff --git a/chrome/content/monkeysphere.js b/chrome/content/monkeysphere.js
index 90cc615..0684dca 100644
--- a/chrome/content/monkeysphere.js
+++ b/chrome/content/monkeysphere.js
@@ -80,7 +80,10 @@ var monkeysphere = (function() {
ms.setStatus(browser, 'NEUTRAL');
} else {
// modify the message to indicate that it's only partially validated
- var newmessage = response.message + ' [Warning: contains non-monkeysphere validated content]';
+ var newmessage = monkeysphere.messages.formatStringFromName
+ ( "statusNONMS"
+ , [ response.message ]
+ , 1 );
ms.setStatus(browser, 'BROKEN', newmessage);
}
return;
@@ -143,7 +146,10 @@ var monkeysphere = (function() {
ms.log("sending query...");
client.send(query);
ms.log("query sent");
- ms.setStatus(browser, 'INPROGRESS', monkeysphere.messages.getString('statusINPROGRESS'));
+ ms.setStatus
+ ( browser
+ , 'INPROGRESS'
+ , monkeysphere.messages.GetStringFromName('statusINPROGRESS') );
};
////////////////////////////////////////////////////////////
@@ -243,7 +249,10 @@ var monkeysphere = (function() {
ms.log("---- begin initialization ----");
// get localization messages
- monkeysphere.messages = document.getElementById("message_strings");
+ monkeysphere.messages
+ = Components.classes["@mozilla.org/intl/stringbundle;1"]
+ .getService(Components.interfaces.nsIStringBundleService)
+ .createBundle("chrome://monkeysphere/locale/messages");
// create event listeners
ms.log("creating listeners...");
@@ -317,7 +326,10 @@ var monkeysphere = (function() {
}
} else {
ms.log("validation agent did not respond.");
- ms.setStatus(browser, 'ERROR', monkeysphere.messages.getString('noResponseFromAgent'));
+ ms.setStatus
+ ( browser
+ , 'ERROR'
+ , monkeysphere.messages.GetStringFromName('noResponseFromAgent') );
}
// update the current display, so that if we're looking at the
@@ -347,10 +359,13 @@ var monkeysphere = (function() {
ms.overrides.clear(apd);
if(ms.overrides.certStatus(apd)) {
ms.log("**** WARNING: override cert not cleared ****");
- alert('Monkeysphere error: override cert not cleared!');
+ alert(monkeysphere.messages.GetStringFromName('msErrorOverrideCertNotCleared'));
}
var newstate = "CLEARED";
- var newmessage = browser.monkeysphere.message + ' [NO LONGER CACHED]';
+ var newmessage = monkeysphere.messages.formatStringFromName
+ ( "statusNOLONGERCACHED"
+ , [ browser.monkeysphere.message ]
+ , 1 );
ms.setStatus(browser, newstate, newmessage);
updateDisplay();
},
@@ -367,13 +382,13 @@ var monkeysphere = (function() {
}
var apd = ms.createAgentPostData(uri, cert);
- var string = "Monkeysphere cache information:\n\n";
- string += "context: " + apd.data.context + "\n";
- string += "peer: " + apd.data.peer + "\n";
- string += "pkc type: " + apd.data.pkc.type + "\n";
- string += "agent response: " + ms.overrides.response(apd).message + "\n";
-
- alert(string);
+ alert(monkeysphere.messages.formatStringFromName
+ ( "showCache"
+ , [ apd.data.context
+ , apd.data.peer
+ , apd.data.pkc.type
+ , ms.overrides.response(apd).message ]
+ , 4 ));
},
certs: function() {
@@ -382,7 +397,7 @@ var monkeysphere = (function() {
help: function() {
ms.log("context menu function: help");
- gBrowser.loadOneTab("chrome://monkeysphere/locale/help.html",
+ gBrowser.loadOneTab("chrome://monkeysphere/content/help.xhtml",
null, null, null, false);
}
}
diff --git a/chrome/content/monkeysphere.xul b/chrome/content/monkeysphere.xul
index a1f69b8..62d2567 100644
--- a/chrome/content/monkeysphere.xul
+++ b/chrome/content/monkeysphere.xul
@@ -17,16 +17,11 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
+<!DOCTYPE messagesDTD SYSTEM "chrome://monkeysphere/locale/messages.dtd">
<overlay id="monkeysphere-statusbar"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<stringbundleset id="stringbundleset">
- <stringbundle id="message_strings"
- src="chrome://monkeysphere/locale/messages"
- insertbefore="1" />
-</stringbundleset>
-
<script type="application/x-javascript" src="monkeysphere.js" />
<script type="text/javascript">
@@ -50,15 +45,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<popupset>
<popup id="monkeysphere-contextmenu" position="after_start">
- <!-- FIXME: need locales stuff for these labels -->
<menuitem id="monkeysphere-status-clearSite"
- label="Clear site Monkeysphere exception"
+ label="&statusbar.popup.menuitem.label.clearSite;"
oncommand="monkeysphere.contextMenuFunctions.clearSite()" />
<menuitem id="monkeysphere-status-showCache"
- label="Show exception information"
+ label="&statusbar.popup.menuitem.label.showCache;"
oncommand="monkeysphere.contextMenuFunctions.showCache()" />
<menuitem id="monkeysphere-status-help"
- label="Help"
+ label="&statusbar.popup.menuitem.label.help;"
oncommand="monkeysphere.contextMenuFunctions.help()" />
</popup>
</popupset>
diff --git a/chrome/locale/en-US/help.dtd b/chrome/locale/en-US/help.dtd
new file mode 100644
index 0000000..5f8bfde
--- /dev/null
+++ b/chrome/locale/en-US/help.dtd
@@ -0,0 +1,16 @@
+<!ENTITY help.title
+ "The Monkeysphere Project - Mozilla/Firefox/Iceweasel XUL Extension">
+<!ENTITY help.project.title
+ "The Monkeysphere Project XUL Extension">
+<!ENTITY help.project.goal
+ "The Monkeysphere project's goal is to extend OpenPGP's web of
+ trust to new areas of the Internet to help us securely identify each
+ other while we work online.">
+<!ENTITY help.project.mozilla-extension
+ "This Mozilla/Firefox/Iceweasel XUL extension, along with a
+ Monkeysphere validation agent, will allow you to validate https web
+ sites that have been put on the OpenPGP web of trust.">
+<!ENTITY help.further-information.title
+ "Further Information">
+<!ENTITY help.further-information.see
+ "For further information, see <a href=%quot;http://monkeysphere.info/%quot;>monkeysphere.info</a>.">
diff --git a/chrome/locale/en-US/messages b/chrome/locale/en-US/messages
index 0f67852..40de572 100644
--- a/chrome/locale/en-US/messages
+++ b/chrome/locale/en-US/messages
@@ -6,6 +6,11 @@ statusNEUTRAL=
statusINPROGRESS=Monkeysphere: querying validation agent...
statusVALID=Monkeysphere: verified the security of your connection to this website and has bypassed Firefox's security error page.
statusNOTVALID=Monkeysphere: unable to verify the security of your connection to this website.
+statusNONMS=%S [Warning: contains non-monkeysphere validated content]
+statusNOLONGERCACHED=%S [NO LONGER CACHED]
xulError=Monkeysphere error: could not determine status message.
noResponseFromAgent=Monkeysphere Validation Agent did not respond.
+msErrorOverrideCertNotCleared=Monkeysphere error: override cert not cleared!
+
+showCache=Monkeysphere cache information:\n\ncontext: %S\n peer: %S\n pkc type: %S\n agent response: %S\n
diff --git a/chrome/locale/en-US/messages.dtd b/chrome/locale/en-US/messages.dtd
new file mode 100644
index 0000000..6b479f9
--- /dev/null
+++ b/chrome/locale/en-US/messages.dtd
@@ -0,0 +1,6 @@
+<!ENTITY statusbar.popup.menuitem.label.clearSite
+ "Clear site Monkeysphere exception">
+<!ENTITY statusbar.popup.menuitem.label.help
+ "Help">
+<!ENTITY statusbar.popup.menuitem.label.showCache
+ "Show exception information">
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/xul-ext-monkeysphere.git
More information about the Pkg-privacy-commits
mailing list