Bug #132159 --> Quick Search: Status text "1 matches found" is grammatically incorrect

patch by stephen walker

r=neil
sr=mscott
This commit is contained in:
scott%scott-macgregor.org 2004-01-27 17:33:33 +00:00
parent baf2466161
commit 1767cd52d8
5 changed files with 42 additions and 6 deletions

View File

@ -58,7 +58,15 @@ var gSearchAbViewListener = {
onSelectionChanged: function() {
},
onCountChanged: function(total) {
var statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
if (total == 0)
var statusText = gAddressBookBundle.getString("noMatchFound");
else
{
if (total == 1)
var statusText = gAddressBookBundle.getString("matchFound");
else
var statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
}
gStatusText.setAttribute("label", statusText);
}
};

View File

@ -575,8 +575,17 @@ function SetStatusText(total)
try {
var statusText;
if (gSearchInput.value)
statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
if (gSearchInput.value) {
if (total == 0)
statusText = gAddressBookBundle.getString("noMatchFound");
else
{
if (total == 1)
statusText = gAddressBookBundle.getString("matchFound");
else
statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
}
}
else
statusText = gAddressBookBundle.getFormattedString("totalCardStatus", [gAbView.directory.dirName, total]);

View File

@ -564,8 +564,17 @@ function SetStatusText(total)
try {
var statusText;
if (gSearchInput.value)
statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
if (gSearchInput.value) {
if (total == 0)
statusText = gAddressBookBundle.getString("noMatchFound");
else
{
if (total == 1)
statusText = gAddressBookBundle.getString("matchFound");
else
statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
}
}
else
statusText = gAddressBookBundle.getFormattedString("totalCardStatus", [gAbView.directory.dirName, total]);

View File

@ -95,6 +95,8 @@ ldap_2.servers.history.description=Collected Addresses
## %1$S is address book name, %2$S is card count
totalCardStatus=Total Cards in %1$S: %2$S
## LOCALIZATION NOTE (matchesFound): do not localize %S
noMatchFound=No matches found
matchFound=1 match found
matchesFound=%S matches found
cardsCopied=%S cards copied
cardCopied=1 card copied

View File

@ -58,7 +58,15 @@ var gSearchAbViewListener = {
onSelectionChanged: function() {
},
onCountChanged: function(total) {
var statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
if (total == 0)
var statusText = gAddressBookBundle.getString("noMatchFound");
else
{
if (total == 1)
var statusText = gAddressBookBundle.getString("matchFound");
else
var statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
}
gStatusText.setAttribute("label", statusText);
}
};