From a7e134164f2a73318138ea6154dabbaff888b6d5 Mon Sep 17 00:00:00 2001 From: danapple Date: Sun, 27 Feb 2011 13:35:59 -0600 Subject: [PATCH] Handle pluralization of import toasts. --- res/values/strings.xml | 3 ++- src/com/fsck/k9/activity/Accounts.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 55c344819..4679163f6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1036,7 +1036,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Exporting settings... Importing settings... Exported settings to %s - Imported %s accounts from %s + Imported %s accounts from %s + Imported 1 account from %s Failed to export settings: %s Failed from import settings from %s:%s diff --git a/src/com/fsck/k9/activity/Accounts.java b/src/com/fsck/k9/activity/Accounts.java index 14d80b379..e7a9213ce 100644 --- a/src/com/fsck/k9/activity/Accounts.java +++ b/src/com/fsck/k9/activity/Accounts.java @@ -829,7 +829,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC public void run() { mHandler.progress(false); - String toastText = Accounts.this.getString(R.string.settings_import_success, numAccounts, fileName ); + String toastText = + numAccounts != 1 + ? Accounts.this.getString(R.string.settings_import_success_multiple, numAccounts, fileName ) + : Accounts.this.getString(R.string.settings_import_success_single, fileName ); Toast toast = Toast.makeText(Accounts.this.getApplication(), toastText, 1); toast.show(); refresh();