summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2018-02-21 22:36:23 +0100
committerMichael Bestas <mkbestas@lineageos.org>2019-11-09 22:15:24 +0200
commit4fc4f6529753dc9c45b947ae70c72e5af042bf85 (patch)
tree48c9d5ceb513979eed8312eb7e7dbd7a1bdaa392
parent5addf81bf2338676c53ab9d63353d870a05c0503 (diff)
downloadandroid_packages_apps_Snap-4fc4f6529753dc9c45b947ae70c72e5af042bf85.zip
android_packages_apps_Snap-4fc4f6529753dc9c45b947ae70c72e5af042bf85.tar.gz
android_packages_apps_Snap-4fc4f6529753dc9c45b947ae70c72e5af042bf85.tar.bz2
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
-rw-r--r--res/values/strings.xml13
-rw-r--r--src/com/android/camera/BestpictureActivity.java7
2 files changed, 15 insertions, 5 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bcf20bf..f579193 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -709,11 +709,20 @@ CHAR LIMIT = NONE] -->
<string name="pref_camera2_restore_default">Restore defaults</string>
<string name="pref_camera2_restore_default_hint">Camera settings will be restored to default settings</string>
- <string name="save_best_dialog_content">%1$d of 10 images will be saved and the rest will deleted.</string>
+ <plurals name="save_best_dialog_content">
+ <item quantity="one">%1$d of 10 images will be saved and the rest will be deleted</item>
+ <item quantity="other">%1$d of 10 images will be saved and the rest will be deleted</item>
+ </plurals>
+
<string name="save_best_dialog_title">Save selected images?</string>
<string name="save_best_dialog_positive_bt">OK</string>
<string name="save_best_dialog_native_bt">Cancel</string>
- <string name="save_best_image_toast">%1$d of 10 images saved.</string>
+
+ <plurals name="save_best_image_toast">
+ <item quantity="one">%1$d of 10 images saved.</item>
+ <item quantity="other">%1$d of 10 images saved.</item>
+ </plurals>
+
<string name="dialog_do_not_show">Do not show again</string>
<string name="delete_best_dialog_title">Delete all?</string>
<string name="delete_best_dialog_content">Are you sure you want to delete all 10 pictures taken?</string>
diff --git a/src/com/android/camera/BestpictureActivity.java b/src/com/android/camera/BestpictureActivity.java
index 6eaa2a3..e4c1ca0 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.plurals.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.plurals.save_best_image_toast,
+ toSaveCount, toSaveCount);
Toast.makeText(BestpictureActivity.this, toastString, Toast.LENGTH_SHORT).show();
backToViewfinder();
}