From 31dd80e88f94f341c6cca2b3a4c2f57eac7e958f Mon Sep 17 00:00:00 2001 From: Simon Depiets Date: Wed, 19 Dec 2018 22:57:28 +0800 Subject: [PATCH] Reorder placeholders for i18n c-format compatibility Summary: Currently a2po exports files with a c-format tag, which means that plural forms "Failed receiving file from %2$s" are invalid for instance (it should be %1 to %n). Translations are subsequently blocked by the subversion pre-commit hooks. This fix reorders the placeholders. Reviewers: #kde_connect, eduisters Reviewed By: #kde_connect, eduisters Subscribers: kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D17688 --- res/values/strings.xml | 8 ++++---- .../kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index ceec3897..43949ac6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -142,12 +142,12 @@ Sent %1$d out of %2$d files - Received file from %2$s - Received %1$d files from %2$s + Received file from %1$s + Received %2$d files from %1$s - Failed receiving file from %3$s - Failed receiving %1$d of %2$d files from %3$s + Failed receiving file from %1$s + Failed receiving %2$d of %3$d files from %1$s Tap to open \'%1s\' Cannot create file %s diff --git a/src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java b/src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java index 013061a2..00396762 100644 --- a/src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java +++ b/src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java @@ -513,7 +513,7 @@ public class SharePlugin extends Plugin implements ReceiveFileRunnable.CallBack //TODO: Show error in notification int failedFiles = info.numberOfFiles() - (info.currentFileNumber - 1); - shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_fail_title, failedFiles, failedFiles, info.numberOfFiles(), device.getName())); + shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_fail_title, failedFiles, device.getName(), failedFiles, info.numberOfFiles())); shareNotification.show(); shareNotification = null; currentShareInfo = null; @@ -532,7 +532,7 @@ public class SharePlugin extends Plugin implements ReceiveFileRunnable.CallBack if (shareNotification != null) { //Update the notification and allow to open the file from it - shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_title, info.numberOfFiles(), info.numberOfFiles(), device.getName())); + shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_title, info.numberOfFiles(), device.getName(), info.numberOfFiles())); if (info.numberOfFiles() == 1) { shareNotification.setURI(info.fileDocument.getUri(), info.fileDocument.getType(), info.fileName);