Fix:4797:Add one more choice to the list (#5173)

This commit is contained in:
Avanish Yadav 2023-03-10 10:51:17 +05:30 committed by GitHub
parent ce1a0b88c3
commit 3f5b7f4c58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 15 deletions

View file

@ -159,24 +159,36 @@ public class DeleteHelper {
boolean[] checkedItems = {false, false, false, false};
ArrayList<Integer> mUserReason = new ArrayList<>();
String[] reasonList = {"Reason 1", "Reason 2", "Reason 3"};
// Messages posted on-wiki should not be in the app user's locale, but rather in Commons' lingua franca English.
String[] reasonListEnglish = {"Eng1", "Eng2", "Eng3"};
final String[] reasonList;
final String[] reasonListEnglish;
if (problem == ReviewController.DeleteReason.SPAM) {
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);
reasonListEnglish[0] = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_spam_selfie);
reasonListEnglish[1] = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_spam_blurry);
reasonListEnglish[2] = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_spam_nonsense);
reasonList = new String[] {
context.getString(R.string.delete_helper_ask_spam_selfie),
context.getString(R.string.delete_helper_ask_spam_blurry),
context.getString(R.string.delete_helper_ask_spam_nonsense)
};
reasonListEnglish = new String[] {
getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_spam_selfie),
getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_spam_blurry),
getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_spam_nonsense)
};
} else if (problem == ReviewController.DeleteReason.COPYRIGHT_VIOLATION) {
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);
reasonListEnglish[0] = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_reason_copyright_press_photo);
reasonListEnglish[1] = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_reason_copyright_internet_photo);
reasonListEnglish[2] = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_reason_copyright_logo);
reasonList = new String[] {
context.getString(R.string.delete_helper_ask_reason_copyright_press_photo),
context.getString(R.string.delete_helper_ask_reason_copyright_internet_photo),
context.getString(R.string.delete_helper_ask_reason_copyright_logo),
context.getString(R.string.delete_helper_ask_reason_copyright_no_freedom_of_panorama)
};
reasonListEnglish = new String[] {
getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_reason_copyright_press_photo),
getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_reason_copyright_internet_photo),
getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_reason_copyright_logo),
getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_reason_copyright_no_freedom_of_panorama)
};
} else {
reasonList = new String[] {};
reasonListEnglish = new String[] {};
}
alert.setMultiChoiceItems(reasonList, checkedItems, listener = (dialogInterface, position, isChecked) -> {

View file

@ -532,6 +532,7 @@ Upload your first media by tapping on the add button.</string>
<string name="delete_helper_ask_reason_copyright_press_photo">Press photo</string>
<string name="delete_helper_ask_reason_copyright_internet_photo">Random photo from internet</string>
<string name="delete_helper_ask_reason_copyright_logo">Logo</string>
<string name="delete_helper_ask_reason_copyright_no_freedom_of_panorama">Breach of Freedom of Panorama</string>
<string name="delete_helper_ask_alert_set_positive_button_reason">Because it is</string>
<string name="category_edit_helper_make_edit_toast">Trying to update categories.</string>