From da30a6d449e43cb253506fb3818e875cf84808b7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 9 Jan 2018 00:23:22 +0100 Subject: TunnelListFragment: fix plural grammar Signed-off-by: Jason A. Donenfeld --- .../java/com/wireguard/android/fragment/TunnelListFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java index 08d39bd5..4634889c 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java @@ -148,12 +148,13 @@ public class TunnelListFragment extends BaseFragment { private void onTunnelDeletionFinished(final Integer count, final Throwable throwable) { final String message; + final String plural = count == 1 ? "" : "s"; if (throwable == null) { - message = "Successfully deleted " + count + " tunnels"; + message = "Successfully deleted " + count + " tunnel" + plural; } else { - message = "Could not delete some tunnels: " + message = "Unable to delete tunnel" + plural + ": " + ExceptionLoggers.unwrap(throwable).getMessage(); - Log.e(TAG, "Cannot delete tunnel", throwable); + Log.e(TAG, "Cannot delete tunnel" + plural, throwable); } if (binding != null) { final CoordinatorLayout container = binding.mainContainer; -- cgit v1.2.3