mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-12 06:52:25 +00:00
bug 97414, localization of datestring in view->pageinfo window, r=pchen, sr=kin, a=asa
This commit is contained in:
parent
a2413bfa99
commit
7b5abb413d
@ -21,6 +21,9 @@
|
||||
* Terry Hayes <thayes@netscape.com>
|
||||
*/
|
||||
|
||||
const nsScriptableDateFormat_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1";
|
||||
const nsIScriptableDateFormat = Components.interfaces.nsIScriptableDateFormat;
|
||||
|
||||
/* Overlays register init functions here.
|
||||
* Add functions to call by invoking "onLoadRegistry.append(XXXLoadFunc);"
|
||||
* The XXXLoadFunc should be unique to the overlay module, and will be
|
||||
@ -93,8 +96,29 @@ function makeDocument(page, root)
|
||||
var lastModified;
|
||||
var lastMod = page.lastModified // get string of last modified date
|
||||
var lastModdate = Date.parse(lastMod) // convert modified string to date
|
||||
|
||||
lastModified = (lastModdate) ? lastMod : "Unknown"; // unknown date (or January 1, 1970 GMT)
|
||||
var lastModified;
|
||||
if (lastModdate) {
|
||||
var date = new Date(lastModdate);
|
||||
try {
|
||||
var dateService = Components.classes[nsScriptableDateFormat_CONTRACTID]
|
||||
.getService(nsIScriptableDateFormat);
|
||||
lastModified = dateService.FormatDateTime(
|
||||
"", dateService.dateFormatLong,
|
||||
dateService.timeFormatSeconds,
|
||||
date.getFullYear(), date.getMonth()+1,
|
||||
date.getDate(), date.getHours(),
|
||||
date.getMinutes(), date.getSeconds());
|
||||
} catch(e) {
|
||||
lastModified = lastMod;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
var pageInfoBundle = document.getElementById("bundle_pageInfo");
|
||||
lastModified = pageInfoBundle.getString("unknown");
|
||||
} catch(e) {
|
||||
lastModified = "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("titletext").setAttribute("value", title);
|
||||
document.getElementById("urltext").setAttribute("value", url);
|
||||
|
@ -48,6 +48,7 @@
|
||||
persist="screenX screenY width height sizemode">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://navigator/content/pageInfo.js"/>
|
||||
<stringbundle src="chrome://navigator/locale/pageInfo.properties" id="bundle_pageInfo"/>
|
||||
|
||||
<!-- keys are appended from the overlay -->
|
||||
<keyset id="dialogKeys"/>
|
||||
|
22
suite/locales/en-US/chrome/browser/pageInfo.properties
Normal file
22
suite/locales/en-US/chrome/browser/pageInfo.properties
Normal file
@ -0,0 +1,22 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and imitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is International
|
||||
# Business Machines Corporation. Portions created by IBM
|
||||
# Corporation are Copyright (C) 2000 International Business
|
||||
# Machines Corporation. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
unknown=Unknown
|
Loading…
x
Reference in New Issue
Block a user