From c01d3b99764ca5da5dfa51bf17974c94932becdf Mon Sep 17 00:00:00 2001 From: Michael W Date: Wed, 21 Feb 2018 22:36:23 +0100 Subject: Snap: Convert "save best" dialog text to a quantity string * Saving 1 vs saving several can be a different string in other languages (e.g. German: "1 von 10 Bildern wird gespeichert[...]" vs "2 von 10 Bildern werden gespeichert[...]") * Also fixes a missing "be" in the source string ("will _be_ deleted") Change-Id: I0f0a91fa3cd1abe17c9d3eef453c4ed706a6fb25 --- res/values/strings.xml | 13 +++++++++++-- src/com/android/camera/BestpictureActivity.java | 7 ++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index f7ab549df..45f5c9741 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -710,11 +710,20 @@ CHAR LIMIT = NONE] --> Restore defaults Camera settings will be restored to default settings - %1$d of 10 images will be saved and the rest will deleted. + + %1$d of 10 images will be saved and the rest will be deleted + %1$d of 10 images will be saved and the rest will be deleted + + Save selected images? OK Cancel - %1$d of 10 images saved. + + + %1$d of 10 images saved. + %1$d of 10 images saved. + + Do not show again Delete all? Are you sure you want to delete all 10 pictures taken? diff --git a/src/com/android/camera/BestpictureActivity.java b/src/com/android/camera/BestpictureActivity.java index 6eaa2a3d0..4edae4177 100644 --- a/src/com/android/camera/BestpictureActivity.java +++ b/src/com/android/camera/BestpictureActivity.java @@ -411,7 +411,8 @@ public class BestpictureActivity extends FragmentActivity { @Override public String getContentString() { - return getResources().getString(R.string.save_best_dialog_content, choosenCount); + return getResources().getQuantityString(R.string.save_best_dialog_content, + choosenCount, choosenCount); } @Override @@ -496,8 +497,8 @@ public class BestpictureActivity extends FragmentActivity { } } } - String toastString = getResources().getString(R.string.save_best_image_toast, - toSaveCount); + String toastString = getResources().getQuantityString(R.string.save_best_image_toast, + toSaveCount, toSaveCount); Toast.makeText(BestpictureActivity.this, toastString, Toast.LENGTH_SHORT).show(); backToViewfinder(); } -- cgit v1.2.3