Replaced strings in two pieces with formatted string

This commit is contained in:
David A. Velasco 2012-07-23 14:38:16 +02:00
parent 6f189bffe1
commit eb2a7bcec2
4 changed files with 5 additions and 9 deletions

View file

@ -18,7 +18,7 @@
--> -->
<manifest package="eu.alefzero.owncloud" <manifest package="eu.alefzero.owncloud"
android:versionCode="1" android:versionCode="1"
android:versionName="0.1.175B" xmlns:android="http://schemas.android.com/apk/res/android"> android:versionName="0.1.176B" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" />

View file

@ -71,8 +71,7 @@
<string name="common_error">Error</string> <string name="common_error">Error</string>
<string name="uploader_info_dirname">Directory name</string> <string name="uploader_info_dirname">Directory name</string>
<string name="uploader_upload_succeed">Upload was successful</string> <string name="uploader_upload_succeed">Upload was successful</string>
<string name="uploader_upload_failed">Upload failed: </string> <string name="uploader_upload_failed">Upload failed: %1$d/%2$d files uploaded</string>
<string name="uploader_files_uploaded_suffix"> files uploaded</string>
<string name="downloader_download_succeed">Download was successful</string> <string name="downloader_download_succeed">Download was successful</string>
<string name="downloader_download_failed">Download could not be completed</string> <string name="downloader_download_failed">Download could not be completed</string>
<string name="common_choose_account">Choose account</string> <string name="common_choose_account">Choose account</string>
@ -132,8 +131,7 @@
<string name="common_rename">Rename</string> <string name="common_rename">Rename</string>
<string name="common_remove">Remove</string> <string name="common_remove">Remove</string>
<string name="confirmation_alert_prefix">"Do you really want "</string> <string name="confirmation_alert">"Do you really want %1$s ?"</string>
<string name="confirmation_alert_suffix">"?"</string>
<string name="remove_success_msg">"Successful removal"</string> <string name="remove_success_msg">"Successful removal"</string>
<string name="remove_fail_msg">"Removal could not be completed"</string> <string name="remove_fail_msg">"Removal could not be completed"</string>

View file

@ -120,9 +120,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
if (mSuccessCounter == mLocalPaths.length) { if (mSuccessCounter == mLocalPaths.length) {
message = getString(R.string.uploader_upload_succeed); message = getString(R.string.uploader_upload_succeed);
} else { } else {
message = getString(R.string.uploader_upload_failed); message = String.format(getString(R.string.uploader_upload_failed), mSuccessCounter, mLocalPaths.length);
if (mLocalPaths.length > 1)
message += " (" + mSuccessCounter + " / " + mLocalPaths.length + getString(R.string.uploader_files_uploaded_suffix) + ")";
} }
Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
} }

View file

@ -35,7 +35,7 @@ public class ConfirmationDialogFragment extends SherlockDialogFragment {
return new AlertDialog.Builder(getActivity()) return new AlertDialog.Builder(getActivity())
.setIcon(android.R.drawable.ic_dialog_alert) .setIcon(android.R.drawable.ic_dialog_alert)
.setMessage(getString(R.string.confirmation_alert_prefix) + confirmationTarget + getString(R.string.confirmation_alert_suffix)) .setMessage(String.format(getString(R.string.confirmation_alert_prefix), confirmationTarget))
.setPositiveButton(R.string.common_ok, .setPositiveButton(R.string.common_ok,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {