bug 369928 - Make 'x items failed to import. The last error was: foo' localizable. Patch by Stefan Sitter <ssitter@googlemail.com>, r=lilmatt

This commit is contained in:
mattwillis%gmail.com 2007-03-07 20:49:59 +00:00
Родитель f118cef754
Коммит 0e125c989a
3 изменённых файлов: 19 добавлений и 5 удалений

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

@ -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);
}
}
}
}

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

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

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

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