Adjust strings for media and calls.

This commit is contained in:
Michelle Tang
2025-01-28 16:41:30 -05:00
committed by Greyson Parrelli
parent c431ba3f7a
commit fd1e47888a
8 changed files with 51 additions and 26 deletions

View File

@@ -435,7 +435,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
}
}
public static void showWarningDialogIfNecessary(Context context, Runnable onSave) {
public static void showWarningDialogIfNecessary(Context context, int count, Runnable onSave) {
if (SignalStore.uiHints().hasDismissedSaveStorageWarning()) {
onSave.run();
} else {
@@ -443,7 +443,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
.setView(R.layout.dialog_save_attachment)
.setTitle(R.string.ConversationFragment__save_to_phone)
.setCancelable(true)
.setMessage(R.string.ConversationFragment__this_media_will_be_saved)
.setMessage(context.getResources().getQuantityString(R.plurals.ConversationFragment__this_media_will_be_saved, count, count))
.setPositiveButton(R.string.save, ((dialog, i) -> {
CheckBox checkbox = ((AlertDialog) dialog).findViewById(R.id.checkbox);
if (checkbox.isChecked()) {

View File

@@ -54,7 +54,7 @@ object SaveAttachmentUtil {
private val TAG = Log.tag(SaveAttachmentUtil::class.java)
fun showWarningDialogIfNecessary(context: Context, onSave: () -> Unit) {
fun showWarningDialogIfNecessary(context: Context, count: Int, onSave: () -> Unit) {
if (SignalStore.uiHints.hasDismissedSaveStorageWarning()) {
onSave()
} else {
@@ -62,7 +62,7 @@ object SaveAttachmentUtil {
.setView(R.layout.dialog_save_attachment)
.setTitle(R.string.ConversationFragment__save_to_phone)
.setCancelable(true)
.setMessage(R.string.ConversationFragment__this_media_will_be_saved)
.setMessage(context.resources.getQuantityString(R.plurals.ConversationFragment__this_media_will_be_saved, count, count))
.setPositiveButton(R.string.save) { dialog, _ ->
val checkbox = (dialog as AlertDialog).findViewById<CheckBox>(R.id.checkbox)!!
if (checkbox.isChecked) {