зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
f118cef754
Коммит
0e125c989a
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -483,12 +483,18 @@ 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 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");
|
||||
|
||||
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:
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче