diff --git a/calendar/base/content/import-export.js b/calendar/base/content/import-export.js index c8e783b4c8e3..ebfc4e746e37 100644 --- a/calendar/base/content/import-export.js +++ b/calendar/base/content/import-export.js @@ -162,8 +162,11 @@ function putItemsIntoCal(destCal, aItems) { // See if it is time to end the calendar's batch. if (count == aItems.length) { destCal.endBatch(); - if (failedCount) - showError(failedCount+" items failed to import. The last error was: "+lastError.toString()); + if (failedCount) { + var msg = calGetString("calendar", "importItemsFailed", + [failedCount, lastError.toString()]); + showError(msg); + } } } } diff --git a/calendar/base/src/calUtils.js b/calendar/base/src/calUtils.js index d74f4c35bcd0..848b6666adda 100644 --- a/calendar/base/src/calUtils.js +++ b/calendar/base/src/calUtils.js @@ -482,13 +482,19 @@ function getLocalizedPref(aPrefName, aDefault) { * * @param aBundleName the name of the properties file. It is assumed that the * file lives in chrome://calendar/locale/ - * @param aStringName the name of the string within the properties file + * @param aStringName the name of the string within the properties file + * @param aParams optional array of parameters to format the string */ -function calGetString(aBundleName, aStringName) { +function calGetString(aBundleName, aStringName, aParams) { var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var props = sbs.createBundle("chrome://calendar/locale/"+aBundleName+".properties"); - return props.GetStringFromName(aStringName); + + if (aParams && aParams.length) { + return props.formatStringFromName(aStringName, aParams, aParams.length); + } else { + return props.GetStringFromName(aStringName); + } } /** Returns a best effort at making a UUID. If we have the UUIDGenerator diff --git a/calendar/locales/en-US/chrome/calendar/calendar.properties b/calendar/locales/en-US/chrome/calendar/calendar.properties index 401ee7f01c9b..76f71687270f 100644 --- a/calendar/locales/en-US/chrome/calendar/calendar.properties +++ b/calendar/locales/en-US/chrome/calendar/calendar.properties @@ -75,6 +75,11 @@ importPrompt=Which calendar do you want to import these items into? exportPrompt=Which calendar do you want to export from? publishPrompt=Which calendar do you want to publish? +# LOCALIZATION NOTE (importItemsFailed): +# %1$S will be replaced with number of failed items +# %2$S will be replaced with last error code / error string +importItemsFailed=%1$S items failed to import. The last error was: %2$S + #spaces needed at the end of the following lines eventDescription=Description: