From dcecf607efd057ebd74b36582ce77640ca011c28 Mon Sep 17 00:00:00 2001 From: misaochan Date: Thu, 15 Dec 2016 15:36:22 +1300 Subject: [PATCH] Add string resources --- .../fr/free/nrw/commons/upload/ExistingFileAsync.java | 9 +++++---- app/src/main/res/values/strings.xml | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/upload/ExistingFileAsync.java b/app/src/main/java/fr/free/nrw/commons/upload/ExistingFileAsync.java index 24e9284d5..85c169040 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/ExistingFileAsync.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/ExistingFileAsync.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import android.support.v7.app.AlertDialog; import fr.free.nrw.commons.CommonsApplication; +import fr.free.nrw.commons.R; import fr.free.nrw.commons.contributions.ContributionsActivity; /** @@ -79,16 +80,16 @@ public class ExistingFileAsync extends AsyncTask { // Use soft warning for now (user able to choose to proceed) until have determined that implementation works without bugs if (fileExists) { AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setMessage("This file already exists in Commons. Are you sure you want to proceed?") - .setTitle("Warning"); - builder.setPositiveButton("No", new DialogInterface.OnClickListener() { + builder.setMessage(R.string.file_exists) + .setTitle(R.string.warning); + builder.setPositiveButton(R.string.no, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //Go back to ContributionsActivity Intent intent = new Intent(context, ContributionsActivity.class); context.startActivity(intent); } }); - builder.setNegativeButton("Yes", new DialogInterface.OnClickListener() { + builder.setNegativeButton(R.string.yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //No need to do anything, user remains on upload screen } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2cee95531..a53a5236d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -168,4 +168,9 @@ Optional permission: Get current location for category suggestions OK Nearby Places + + Warning + This file already exists on Commons. Are you sure you want to proceed? + Yes + No