From 249248e168a152e7502ba331bf86ab88c7815110 Mon Sep 17 00:00:00 2001 From: حسين Date: Wed, 2 Jan 2019 18:10:47 +0000 Subject: improve translations with format strings delete dialog format string dialog text format --- app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 7 +++---- app/src/main/java/com/zeapo/pwdstore/UserPreference.kt | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'app/src/main/java/com/zeapo') diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 123acd2d..8a5acec8 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -536,10 +536,9 @@ public class PasswordStore extends AppCompatActivity { } final int position = (int) it.next(); final PasswordItem item = adapter.getValues().get(position); - new AlertDialog.Builder(this). - setMessage(this.getResources().getString(R.string.delete_dialog_text) + - item + "\"") - .setPositiveButton(this.getResources().getString(R.string.dialog_yes), (dialogInterface, i) -> { + new AlertDialog.Builder(this) + .setMessage(getResources().getString(R.string.delete_dialog_text, item.getLongName())) + .setPositiveButton(getResources().getString(R.string.dialog_yes), (dialogInterface, i) -> { item.getFile().delete(); adapter.remove(position); it.remove(); diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt index d93d6bcc..2f36c965 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt @@ -108,7 +108,7 @@ class UserPreference : AppCompatActivity() { val repoDir = PasswordRepository.getRepositoryDirectory(callingActivity.applicationContext) AlertDialog.Builder(callingActivity) .setTitle(R.string.pref_dialog_delete_title) - .setMessage("${resources.getString(R.string.dialog_delete_msg)} \n $repoDir") + .setMessage(resources.getString(R.string.dialog_delete_msg, repoDir)) .setCancelable(false) .setPositiveButton(R.string.dialog_delete) { dialogInterface, _ -> try { -- cgit v1.2.3