@@ -59,7 +59,7 @@ public DeleteHelper(MediaWikiApi mwApi,
5959 * @return
6060 */
6161 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 ()) );
6363 return Single .fromCallable (() -> delete (media , reason ))
6464 .flatMap (result -> Single .fromCallable (() ->
6565 showDeletionNotification (context , media , result )));
@@ -123,14 +123,14 @@ private boolean delete(Media media, String reason) {
123123
124124 private boolean showDeletionNotification (Context context , Media media , boolean result ) {
125125 String message ;
126- String title = "Nominating for Deletion" ;
126+ String title = context . getString ( R . string . delete_helper_show_deletion_title ) ;
127127
128128 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 ()) ;
131131 } 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 ) ;
134134 }
135135
136136 String urlForDelete = BuildConfig .COMMONS_URL + "/wiki/Commons:Deletion_requests/" + media .getFilename ();
@@ -162,15 +162,15 @@ public void askReasonAndExecute(Media media,
162162
163163
164164 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 );
169169 } 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 );
174174 }
175175
176176 alert .setMultiChoiceItems (reasonList , checkedItems , (dialogInterface , position , isChecked ) -> {
@@ -181,9 +181,9 @@ public void askReasonAndExecute(Media media,
181181 }
182182 });
183183
184- alert .setPositiveButton ("OK" , (dialogInterface , i ) -> {
184+ alert .setPositiveButton (context . getString ( R . string . ok ) , (dialogInterface , i ) -> {
185185
186- String reason = "Because it is " ;
186+ String reason = context . getString ( R . string . delete_helper_ask_alert_set_positive_button_reason ) + " " ;
187187 for (int j = 0 ; j < mUserReason .size (); j ++) {
188188 reason = reason + reasonList [mUserReason .get (j )];
189189 if (j != mUserReason .size () - 1 ) {
@@ -203,7 +203,7 @@ public void askReasonAndExecute(Media media,
203203 });
204204
205205 });
206- alert .setNegativeButton ("Cancel" , (dialog , which ) -> reviewCallback .onFailure ());
206+ alert .setNegativeButton (context . getString ( R . string . cancel ) , (dialog , which ) -> reviewCallback .onFailure ());
207207 AlertDialog d = alert .create ();
208208 d .show ();
209209 }
0 commit comments