2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 21:55:10 +00:00

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
This commit is contained in:
Simon Depiets
2018-12-19 22:57:28 +08:00
parent e77827d733
commit 31dd80e88f
2 changed files with 6 additions and 6 deletions

View File

@@ -142,12 +142,12 @@
<item quantity="other">Sent %1$d out of %2$d files</item> <item quantity="other">Sent %1$d out of %2$d files</item>
</plurals> </plurals>
<plurals name="received_files_title"> <plurals name="received_files_title">
<item quantity="one">Received file from %2$s</item> <item quantity="one">Received file from %1$s</item>
<item quantity="other">Received %1$d files from %2$s</item> <item quantity="other">Received %2$d files from %1$s</item>
</plurals> </plurals>
<plurals name="received_files_fail_title"> <plurals name="received_files_fail_title">
<item quantity="one">Failed receiving file from %3$s</item> <item quantity="one">Failed receiving file from %1$s</item>
<item quantity="other">Failed receiving %1$d of %2$d files from %3$s</item> <item quantity="other">Failed receiving %2$d of %3$d files from %1$s</item>
</plurals> </plurals>
<string name="received_file_text">Tap to open \'%1s\'</string> <string name="received_file_text">Tap to open \'%1s\'</string>
<string name="cannot_create_file">Cannot create file %s</string> <string name="cannot_create_file">Cannot create file %s</string>

View File

@@ -513,7 +513,7 @@ public class SharePlugin extends Plugin implements ReceiveFileRunnable.CallBack
//TODO: Show error in notification //TODO: Show error in notification
int failedFiles = info.numberOfFiles() - (info.currentFileNumber - 1); 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.show();
shareNotification = null; shareNotification = null;
currentShareInfo = null; currentShareInfo = null;
@@ -532,7 +532,7 @@ public class SharePlugin extends Plugin implements ReceiveFileRunnable.CallBack
if (shareNotification != null) { if (shareNotification != null) {
//Update the notification and allow to open the file from it //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) { if (info.numberOfFiles() == 1) {
shareNotification.setURI(info.fileDocument.getUri(), info.fileDocument.getType(), info.fileName); shareNotification.setURI(info.fileDocument.getUri(), info.fileDocument.getType(), info.fileName);