From ee452ee5359cdfa3c3fbf6783722d3aaa2ec5ca6 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 31 Aug 2009 17:58:06 -0700 Subject: [PATCH] Combine the "Permission Requested" title and subtitle into one string. The translators don't get the strings in order, so having a single sentence split across two strings makes it difficult to get good translations. --- core/java/android/accounts/AccountManagerService.java | 11 +++++++---- core/res/res/values/strings.xml | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java index c13893a5a5743..0bdcc1df1c77a 100644 --- a/core/java/android/accounts/AccountManagerService.java +++ b/core/java/android/accounts/AccountManagerService.java @@ -714,11 +714,14 @@ public class AccountManagerService extends IAccountManager.Stub { Notification n = new Notification(android.R.drawable.stat_sys_warning, null, 0 /* when */); - final CharSequence subtitleFormatString = - mContext.getText(R.string.permission_request_notification_subtitle); + final String titleAndSubtitle = + mContext.getString(R.string.permission_request_notification_with_subtitle, + account.name); + final int index = titleAndSubtitle.indexOf('\n'); + final String title = titleAndSubtitle.substring(0, index); + final String subtitle = titleAndSubtitle.substring(index + 1); n.setLatestEventInfo(mContext, - mContext.getText(R.string.permission_request_notification_title), - String.format(subtitleFormatString.toString(), account.name), + title, subtitle, PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)); ((NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE)) .notify(getCredentialPermissionNotificationId(account, authTokenType, uid), n); diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 69ddd630f0e97..bd79c752fc495 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -1962,7 +1962,7 @@ Allow Deny Permission Requested - for account %s + Permission Requested\nfor account %s Input method