bug 97414, localization of datestring in view->pageinfo window, r=pchen, sr=kin, a=asa

This commit is contained in:
morse%netscape.com 2001-08-30 00:37:57 +00:00
Родитель d8b557ac56
Коммит 8f6ea28242
4 изменённых файлов: 50 добавлений и 2 удалений

Просмотреть файл

@ -27,6 +27,7 @@ en-US.jar:
locale/en-US/navigator/navigator.properties (resources/locale/en-US/navigator.properties)
locale/en-US/navigator/metadata.dtd (resources/locale/en-US/metadata.dtd)
locale/en-US/navigator/metadata.properties (resources/locale/en-US/metadata.properties)
locale/en-US/navigator/pageInfo.properties (resources/locale/en-US/pageInfo.properties)
US.jar:
locale/US/navigator-region/contents.rdf (resources/locale/en-US/contents-region.rdf)

Просмотреть файл

@ -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"/>

Просмотреть файл

@ -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