@@ -59,7 +59,7 @@ public DeleteHelper(MediaWikiApi mwApi,
59
59
* @return
60
60
*/
61
61
public Single <Boolean > makeDeletion (Context context , Media media , String reason ) {
62
- viewUtil .showShortToast (context , "Trying to nominate " + media .getDisplayTitle () + " for deletion" );
62
+ viewUtil .showShortToast (context , context . getString (( R . string . delete_helper_make_deletion_toast ), media .getDisplayTitle ()) );
63
63
return Single .fromCallable (() -> delete (media , reason ))
64
64
.flatMap (result -> Single .fromCallable (() ->
65
65
showDeletionNotification (context , media , result )));
@@ -123,14 +123,14 @@ private boolean delete(Media media, String reason) {
123
123
124
124
private boolean showDeletionNotification (Context context , Media media , boolean result ) {
125
125
String message ;
126
- String title = "Nominating for Deletion" ;
126
+ String title = context . getString ( R . string . delete_helper_show_deletion_title ) ;
127
127
128
128
if (result ) {
129
- title += ": Success" ;
130
- message = "Successfully nominated " + media .getDisplayTitle () + " deletion." ;
129
+ title += ": " + context . getString ( R . string . delete_helper_show_deletion_title_success ) ;
130
+ message = context . getString (( R . string . delete_helper_show_deletion_message_if ), media .getDisplayTitle ()) ;
131
131
} else {
132
- title += ": Failed" ;
133
- message = "Could not request deletion." ;
132
+ title += ": " + context . getString ( R . string . delete_helper_show_deletion_title_failed ) ;
133
+ message = context . getString ( R . string . delete_helper_show_deletion_message_else ) ;
134
134
}
135
135
136
136
String urlForDelete = BuildConfig .COMMONS_URL + "/wiki/Commons:Deletion_requests/" + media .getFilename ();
@@ -162,15 +162,15 @@ public void askReasonAndExecute(Media media,
162
162
163
163
164
164
if (problem == ReviewController .DeleteReason .SPAM ) {
165
- reasonList [0 ] = context .getResources (). getString (R .string .delete_reason_spam_selfie );
166
- reasonList [1 ] = context .getResources (). getString (R .string .delete_reason_spam_blurry );
167
- reasonList [2 ] = context .getResources (). getString (R .string .delete_reason_spam_nonsense );
168
- reasonList [3 ] = context .getResources (). getString (R .string .delete_reason_spam_other );
165
+ reasonList [0 ] = context .getString (R .string .delete_helper_ask_spam_selfie );
166
+ reasonList [1 ] = context .getString (R .string .delete_helper_ask_spam_blurry );
167
+ reasonList [2 ] = context .getString (R .string .delete_helper_ask_spam_nonsense );
168
+ reasonList [3 ] = context .getString (R .string .delete_helper_ask_spam_other );
169
169
} else if (problem == ReviewController .DeleteReason .COPYRIGHT_VIOLATION ) {
170
- reasonList [0 ] = context .getResources (). getString (R .string .delete_reason_copyright_pressphoto );
171
- reasonList [1 ] = context .getResources (). getString (R .string .delete_reason_copyright_internetphoto );
172
- reasonList [2 ] = context .getResources (). getString (R .string .delete_reason_copyright_logo );
173
- reasonList [3 ] = context .getResources (). getString (R .string .delete_reason_copyright_other );
170
+ reasonList [0 ] = context .getString (R .string .delete_helper_ask_reason_copyright_press_photo );
171
+ reasonList [1 ] = context .getString (R .string .delete_helper_ask_reason_copyright_internet_photo );
172
+ reasonList [2 ] = context .getString (R .string .delete_helper_ask_reason_copyright_logo );
173
+ reasonList [3 ] = context .getString (R .string .delete_helper_ask_reason_copyright_other );
174
174
}
175
175
176
176
alert .setMultiChoiceItems (reasonList , checkedItems , (dialogInterface , position , isChecked ) -> {
@@ -181,9 +181,9 @@ public void askReasonAndExecute(Media media,
181
181
}
182
182
});
183
183
184
- alert .setPositiveButton ("OK" , (dialogInterface , i ) -> {
184
+ alert .setPositiveButton (context . getString ( R . string . ok ) , (dialogInterface , i ) -> {
185
185
186
- String reason = "Because it is " ;
186
+ String reason = context . getString ( R . string . delete_helper_ask_alert_set_positive_button_reason ) + " " ;
187
187
for (int j = 0 ; j < mUserReason .size (); j ++) {
188
188
reason = reason + reasonList [mUserReason .get (j )];
189
189
if (j != mUserReason .size () - 1 ) {
@@ -203,7 +203,7 @@ public void askReasonAndExecute(Media media,
203
203
});
204
204
205
205
});
206
- alert .setNegativeButton ("Cancel" , (dialog , which ) -> reviewCallback .onFailure ());
206
+ alert .setNegativeButton (context . getString ( R . string . cancel ) , (dialog , which ) -> reviewCallback .onFailure ());
207
207
AlertDialog d = alert .create ();
208
208
d .show ();
209
209
}
0 commit comments