diff --git a/app/src/main/java/fr/free/nrw/commons/delete/DeleteHelper.java b/app/src/main/java/fr/free/nrw/commons/delete/DeleteHelper.java index fe91010eb..a5d7e7ef7 100644 --- a/app/src/main/java/fr/free/nrw/commons/delete/DeleteHelper.java +++ b/app/src/main/java/fr/free/nrw/commons/delete/DeleteHelper.java @@ -59,7 +59,7 @@ public class DeleteHelper { * @return */ public Single makeDeletion(Context context, Media media, String reason) { - viewUtil.showShortToast(context, "Trying to nominate " + media.getDisplayTitle() + " for deletion"); + viewUtil.showShortToast(context, context.getString((R.string.delete_helper_make_deletion_toast), media.getDisplayTitle())); return Single.fromCallable(() -> delete(media, reason)) .flatMap(result -> Single.fromCallable(() -> showDeletionNotification(context, media, result))); @@ -123,14 +123,14 @@ public class DeleteHelper { private boolean showDeletionNotification(Context context, Media media, boolean result) { String message; - String title = "Nominating for Deletion"; + String title = context.getString(R.string.delete_helper_show_deletion_title); if (result) { - title += ": Success"; - message = "Successfully nominated " + media.getDisplayTitle() + " deletion."; + title += ": " + context.getString(R.string.delete_helper_show_deletion_title_success); + message = context.getString((R.string.delete_helper_show_deletion_message_if),media.getDisplayTitle()); } else { - title += ": Failed"; - message = "Could not request deletion."; + title += ": " + context.getString(R.string.delete_helper_show_deletion_title_failed); + message = context.getString(R.string.delete_helper_show_deletion_message_else) ; } String urlForDelete = BuildConfig.COMMONS_URL + "/wiki/Commons:Deletion_requests/" + media.getFilename(); @@ -162,15 +162,15 @@ public class DeleteHelper { if (problem == ReviewController.DeleteReason.SPAM) { - reasonList[0] = context.getResources().getString(R.string.delete_reason_spam_selfie); - reasonList[1] = context.getResources().getString(R.string.delete_reason_spam_blurry); - reasonList[2] = context.getResources().getString(R.string.delete_reason_spam_nonsense); - reasonList[3] = context.getResources().getString(R.string.delete_reason_spam_other); + reasonList[0] = context.getString(R.string.delete_helper_ask_spam_selfie); + reasonList[1] = context.getString(R.string.delete_helper_ask_spam_blurry); + reasonList[2] = context.getString(R.string.delete_helper_ask_spam_nonsense); + reasonList[3] = context.getString(R.string.delete_helper_ask_spam_other); } else if (problem == ReviewController.DeleteReason.COPYRIGHT_VIOLATION) { - reasonList[0] = context.getResources().getString(R.string.delete_reason_copyright_pressphoto); - reasonList[1] = context.getResources().getString(R.string.delete_reason_copyright_internetphoto); - reasonList[2] = context.getResources().getString(R.string.delete_reason_copyright_logo); - reasonList[3] = context.getResources().getString(R.string.delete_reason_copyright_other); + reasonList[0] = context.getString(R.string.delete_helper_ask_reason_copyright_press_photo); + reasonList[1] = context.getString(R.string.delete_helper_ask_reason_copyright_internet_photo); + reasonList[2] = context.getString(R.string.delete_helper_ask_reason_copyright_logo); + reasonList[3] = context.getString(R.string.delete_helper_ask_reason_copyright_other); } alert.setMultiChoiceItems(reasonList, checkedItems, (dialogInterface, position, isChecked) -> { @@ -181,9 +181,9 @@ public class DeleteHelper { } }); - alert.setPositiveButton("OK", (dialogInterface, i) -> { + alert.setPositiveButton(context.getString(R.string.ok), (dialogInterface, i) -> { - String reason = "Because it is "; + String reason = context.getString(R.string.delete_helper_ask_alert_set_positive_button_reason) + " "; for (int j = 0; j < mUserReason.size(); j++) { reason = reason + reasonList[mUserReason.get(j)]; if (j != mUserReason.size() - 1) { @@ -203,7 +203,7 @@ public class DeleteHelper { }); }); - alert.setNegativeButton("Cancel", (dialog, which) -> reviewCallback.onFailure()); + alert.setNegativeButton(context.getString(R.string.cancel), (dialog, which) -> reviewCallback.onFailure()); AlertDialog d = alert.create(); d.show(); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 08cad0620..9fe8836aa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -560,12 +560,19 @@ Upload your first media by tapping on the add button. Why should %1$s be deleted? %1$s is uploaded by: %2$s Default description language - A selfie - Blurry - Nonsense - Other - Press photo - Random photo from internet - Logo - Other + Trying to nominate %1$s for deletion + Nominating for deletion + Success + Successfully nominated %1$s for deletion. + Failed + Could not request deletion. + A selfie + Blurry + Nonsense + Other + Press photo + Random photo from internet + Logo + Other + Because it is