Include source origin in string key name.

This should help eliminate string duplicates, as well as provide
visibility into where strings in a resource file are being used.
This commit is contained in:
Moxie Marlinspike
2012-09-19 19:56:04 -07:00
parent faad1e57ea
commit bb0ec65744
63 changed files with 579 additions and 547 deletions

View File

@@ -80,7 +80,8 @@ public class ApplicationMigrationService extends Service
private Notification initializeBackgroundNotification() {
Intent intent = new Intent(this, ConversationListActivity.class);
Notification notification = new Notification(R.drawable.icon, getString(R.string.migrating),
Notification notification = new Notification(R.drawable.icon,
getString(R.string.ApplicationMigrationService_migrating),
System.currentTimeMillis());
notification.flags = notification.flags | Notification.FLAG_ONGOING_EVENT;
@@ -89,7 +90,8 @@ public class ApplicationMigrationService extends Service
notification.contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, 0);
notification.contentView.setImageViewResource(R.id.status_icon, R.drawable.icon);
notification.contentView.setTextViewText(R.id.status_text, getString(R.string.migrating_system_text_messages));
notification.contentView.setTextViewText(R.id.status_text,
getString(R.string.ApplicationMigrationService_migrating_system_text_messages));
notification.contentView.setProgressBar(R.id.status_progress, 10000, 0, false);
stopForeground(true);

View File

@@ -160,12 +160,14 @@ public class KeyCachingService extends Service {
private void foregroundServiceLegacy() {
Notification notification = new Notification(R.drawable.icon_cached,
getString(R.string.textsecure_passphrase_cached),
getString(R.string.KeyCachingService_textsecure_passphrase_cached),
System.currentTimeMillis());
Intent intent = new Intent(this, ConversationListActivity.class);
PendingIntent launchIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, 0);
notification.setLatestEventInfo(getApplicationContext(), getString(R.string.passphrase_cached),
getString(R.string.textsecure_passphrase_cached), launchIntent);
notification.setLatestEventInfo(getApplicationContext(),
getString(R.string.KeyCachingService_passphrase_cached),
getString(R.string.KeyCachingService_textsecure_passphrase_cached),
launchIntent);
stopForeground(true);
startForeground(SERVICE_RUNNING_ID, notification);

View File

@@ -70,22 +70,22 @@ public class MessageNotifier {
Recipient recipient = recipients.getPrimaryRecipient();
if (recipient == null) {
return String.format(context.getString(R.string._d_new_messages), count);
return String.format(context.getString(R.string.MessageNotifier_d_new_messages), count);
} else {
return String.format(context.getString(R.string._d_new_messages_most_recent_from_s), count,
return String.format(context.getString(R.string.MessageNotifier_d_new_messages_most_recent_from_s), count,
recipient.getName() == null ? recipient.getNumber() : recipient.getName());
}
}
private static String buildTitleMessage(Context context, int count) {
return String.format(context.getString(R.string._d_new_messages), count);
return String.format(context.getString(R.string.MessageNotifier_d_new_messages), count);
}
private static String buildSubtitleMessage(Context context, Recipients recipients) {
Recipient recipient = recipients.getPrimaryRecipient();
if (recipient != null) {
return String.format(context.getString(R.string.most_recent_from_s),
return String.format(context.getString(R.string.MessageNotifier_most_recent_from_s),
(recipient.getName() == null ? recipient.getNumber() : recipient.getName()));
}