From 8e1970c398f5a2896f0738cfeb26230547b6b0a0 Mon Sep 17 00:00:00 2001 From: RiseT Date: Mon, 10 Oct 2016 19:07:22 +0200 Subject: [PATCH] Make message and thread records for changed safety numbers translatable Fixes #5769 Closes #5771 Makes the message and thread records for 'Your safety numbers with %s have changed' translatable. // FREEBIE --- res/values/strings.xml | 2 ++ .../thoughtcrime/securesms/database/model/MessageRecord.java | 2 +- src/org/thoughtcrime/securesms/database/model/ThreadRecord.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 603808aecd..d25ae0b6fd 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -385,6 +385,7 @@ %s is on Signal, say hey! You %1$s set disappearing message time to %2$s + Your safety numbers with %s have changed @@ -550,6 +551,7 @@ Media message %s is on Signal, say hey! Disappearing message time set to %s + Your safety numbers with %s have changed Your contact is running an old version of Signal, please ask them to update before verifying safety numbers. diff --git a/src/org/thoughtcrime/securesms/database/model/MessageRecord.java b/src/org/thoughtcrime/securesms/database/model/MessageRecord.java index d6c38bc94c..bf02830d40 100644 --- a/src/org/thoughtcrime/securesms/database/model/MessageRecord.java +++ b/src/org/thoughtcrime/securesms/database/model/MessageRecord.java @@ -113,7 +113,7 @@ public abstract class MessageRecord extends DisplayRecord { String time = ExpirationUtil.getExpirationDisplayValue(context, (int) (getExpiresIn() / 1000)); return emphasisAdded(context.getString(R.string.MessageRecord_s_set_disappearing_message_time_to_s, sender, time)); } else if (isIdentityUpdate()) { - return emphasisAdded(String.format("Your safety numbers with %s have changed", getIndividualRecipient().toShortString())); + return emphasisAdded(context.getString(R.string.MessageRecord_your_safety_numbers_with_s_have_changed, getIndividualRecipient().toShortString())); } else if (getBody().getBody().length() > MAX_DISPLAY_LENGTH) { return new SpannableString(getBody().getBody().substring(0, MAX_DISPLAY_LENGTH)); } diff --git a/src/org/thoughtcrime/securesms/database/model/ThreadRecord.java b/src/org/thoughtcrime/securesms/database/model/ThreadRecord.java index 0ff9fbf8af..fe0fd2947a 100644 --- a/src/org/thoughtcrime/securesms/database/model/ThreadRecord.java +++ b/src/org/thoughtcrime/securesms/database/model/ThreadRecord.java @@ -103,7 +103,7 @@ public class ThreadRecord extends DisplayRecord { String time = ExpirationUtil.getExpirationDisplayValue(context, (int) (getExpiresIn() / 1000)); return emphasisAdded(context.getString(R.string.ThreadRecord_disappearing_message_time_updated_to_s, time)); } else if (SmsDatabase.Types.isIdentityUpdate(type)) { - return emphasisAdded(String.format("Your safety numbers with %s have changed", getRecipients().getPrimaryRecipient().toShortString())); + return emphasisAdded(context.getString(R.string.ThreadRecord_your_safety_numbers_with_s_have_changed, getRecipients().getPrimaryRecipient().toShortString())); } else { if (TextUtils.isEmpty(getBody().getBody())) { return new SpannableString(emphasisAdded(context.getString(R.string.ThreadRecord_media_message)));