1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

Pluralize the "Move to spam" confirmation dialog since code paths were

unified in MessageList and multi-selection is now subject to this
dialog.
This commit is contained in:
Fiouz 2011-06-05 01:35:11 +02:00
parent de7b75a1df
commit 72870174ce
3 changed files with 14 additions and 4 deletions

View File

@ -1035,7 +1035,10 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="dialog_confirm_delete_cancel_button">Do not delete</string> <string name="dialog_confirm_delete_cancel_button">Do not delete</string>
<string name="dialog_confirm_spam_title">Confirm move to spam folder</string> <string name="dialog_confirm_spam_title">Confirm move to spam folder</string>
<string name="dialog_confirm_spam_message">Do you really want to move this message to the spam folder?</string> <plurals name="dialog_confirm_spam_message">
<item quantity="one">Do you really want to move this message to the spam folder?</item>
<item quantity="other">Do you really want to move %1$d messages to the spam folder?</item>
</plurals>
<string name="dialog_confirm_spam_confirm_button">Yes</string> <string name="dialog_confirm_spam_confirm_button">Yes</string>
<string name="dialog_confirm_spam_cancel_button">No</string> <string name="dialog_confirm_spam_cancel_button">No</string>

View File

@ -1277,7 +1277,7 @@ public class MessageList
case R.id.dialog_confirm_spam: case R.id.dialog_confirm_spam:
return ConfirmationDialog.create(this, id, return ConfirmationDialog.create(this, id,
R.string.dialog_confirm_spam_title, R.string.dialog_confirm_spam_title,
R.string.dialog_confirm_spam_message, "" /* text is refreshed by #onPrepareDialog(int, Dialog) below */,
R.string.dialog_confirm_spam_confirm_button, R.string.dialog_confirm_spam_confirm_button,
R.string.dialog_confirm_spam_cancel_button, R.string.dialog_confirm_spam_cancel_button,
new Runnable() { new Runnable() {
@ -1294,7 +1294,7 @@ public class MessageList
} }
@Override @Override
public void onPrepareDialog(int id, Dialog dialog) { public void onPrepareDialog(final int id, final Dialog dialog) {
switch (id) { switch (id) {
case DIALOG_MARK_ALL_AS_READ: { case DIALOG_MARK_ALL_AS_READ: {
if (mCurrentFolder != null) { if (mCurrentFolder != null) {
@ -1303,6 +1303,13 @@ public class MessageList
} }
break; break;
} }
case R.id.dialog_confirm_spam: {
final int selectionSize = mActiveMessages.size();
final String message;
message = getResources().getQuantityString(R.plurals.dialog_confirm_spam_message, selectionSize, Integer.valueOf(selectionSize));
((AlertDialog) dialog).setMessage(message);
break;
}
default: { default: {
super.onPrepareDialog(id, dialog); super.onPrepareDialog(id, dialog);
} }

View File

@ -994,7 +994,7 @@ public class MessageView extends K9Activity implements OnClickListener {
case R.id.dialog_confirm_spam: case R.id.dialog_confirm_spam:
return ConfirmationDialog.create(this, id, return ConfirmationDialog.create(this, id,
R.string.dialog_confirm_spam_title, R.string.dialog_confirm_spam_title,
R.string.dialog_confirm_spam_message, getResources().getQuantityString(R.plurals.dialog_confirm_spam_message, 1),
R.string.dialog_confirm_spam_confirm_button, R.string.dialog_confirm_spam_confirm_button,
R.string.dialog_confirm_spam_cancel_button, R.string.dialog_confirm_spam_cancel_button,
new Runnable() { new Runnable() {