Bug 395773 - "Bookmarks backup suggests invalid file name" [p=dao@design-noir.de (Dão Gottwald) r=sspitzer a1.9=mconnor]

This commit is contained in:
reed@reedloden.com 2007-09-17 14:14:15 -07:00
parent ca96c9ff66
commit d1644b5ae3
3 changed files with 12 additions and 8 deletions

View File

@ -398,12 +398,9 @@ var PlacesOrganizer = {
var backupsDir = dirSvc.get("Desk", Ci.nsILocalFile);
fp.displayDirectory = backupsDir;
var dateService = Cc["@mozilla.org/intl/scriptabledateformat;1"].
getService(Ci.nsIScriptableDateFormat);
var d = new Date();
var date = dateService.FormatDate("", dateService.dateFormatShort,
d.getFullYear(), d.getMonth() + 1, d.getDate());
// Use YYYY-MM-DD (ISO 8601) as it doesn't contain illegal characters
// and makes the alphabetical order of multiple backup files more useful.
var date = (new Date).toLocaleFormat("%Y-%m-%d");
fp.defaultString = PlacesUtils.getFormattedString("bookmarksBackupFilename",
[date]);

View File

@ -2538,6 +2538,8 @@ nsPlacesImportExportService::ArchiveBookmarksFile(PRInt32 numberOfBackups,
char timeString[128];
// Use YYYY-MM-DD (ISO 8601) as it doesn't contain illegal characters
// and makes the alphabetical order of multiple backup files more useful.
PR_FormatTime(timeString, 128, "bookmarks-%Y-%m-%d.html", &nowInfo);
//nsCAutoString backupFilenameCString(timeString);

View File

@ -20,7 +20,12 @@ bookmarksMenuEmptyFolder=(Empty)
bookmarksLivemarkLoading=Live Bookmark loading...
bookmarksLivemarkFailed=Live Bookmark feed failed to load.
bookmarksBackupFilename=Bookmarks %1$S.html
# LOCALIZATION NOTE (bookmarksBackupFilename) :
# %S will be replaced by the current date in ISO 8601 format, YYYY-MM-DD.
# The resulting string will be suggested as a filename, so make sure that you're
# only using characters legal for file names. Consider falling back to the
# en-US value if you have to use non-ascii characters.
bookmarksBackupFilename=Bookmarks %S.html
bookmarksBackupTitle=Bookmarks backup filename
bookmarksRestoreAlertTitle=Revert Bookmarks