diff --git a/commons/res/values/strings.xml b/commons/res/values/strings.xml index e46a56ab1..d77caf93b 100644 --- a/commons/res/values/strings.xml +++ b/commons/res/values/strings.xml @@ -21,7 +21,10 @@ Finishing uploading %1$s Uploading %1$s failed Tap to view - %d files uploading + + 1 file uploading + %d files uploading + My uploads Queued @@ -36,13 +39,15 @@ View in Browser Title Description + Unable to login - network failure Unable to login - please check your username - Unable to login - please heck your password - You have had too many unsuccessfull attempts. Please try again in 5 minutes + Unable to login - please check your password + Too many unsuccessful attempts. Please try again in a few minutes Sorry, this user has been blocked on Commons Login failed + Upload diff --git a/commons/src/main/java/org/wikimedia/commons/UploadService.java b/commons/src/main/java/org/wikimedia/commons/UploadService.java index e8063b686..36aa82b3e 100644 --- a/commons/src/main/java/org/wikimedia/commons/UploadService.java +++ b/commons/src/main/java/org/wikimedia/commons/UploadService.java @@ -67,7 +67,6 @@ public class UploadService extends HandlerService { Log.d("Commons", String.format("Uploaded %d of %d", transferred, total)); if(!notificationTitleChanged) { curProgressNotification.setContentTitle(notificationProgressTitle); - Log.d("Commons", String.format("%d uploads left", toUpload)); notificationTitleChanged = true; contribution.setState(Contribution.STATE_IN_PROGRESS); } @@ -124,7 +123,7 @@ public class UploadService extends HandlerService { contribution.save(); toUpload++; if (curProgressNotification != null && toUpload != 1) { - curProgressNotification.setContentText(String.format(getString(R.string.uploads_pending_notification_indicator), toUpload)); + curProgressNotification.setContentText(getResources().getQuantityString(R.plurals.uploads_pending_notification_indicator, toUpload, toUpload)); Log.d("Commons", String.format("%d uploads left", toUpload)); notificationManager.notify(NOTIFICATION_UPLOAD_IN_PROGRESS, curProgressNotification.build()); } @@ -178,7 +177,7 @@ public class UploadService extends HandlerService { .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher)) .setAutoCancel(true) .setContentTitle(String.format(getString(R.string.upload_progress_notification_title_start), contribution.getFilename())) - .setContentText(String.format(getString(R.string.uploads_pending_notification_indicator), toUpload)) + .setContentText(getResources().getQuantityString(R.plurals.uploads_pending_notification_indicator, toUpload, toUpload)) .setOngoing(true) .setProgress(100, 0, true) .setContentIntent(PendingIntent.getActivity(getApplicationContext(), 0, new Intent(this, ContributionsActivity.class), 0))