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
This commit is contained in:
RiseT
2016-10-10 19:07:22 +02:00
committed by Moxie Marlinspike
parent 38ec5647dd
commit 8e1970c398
3 changed files with 4 additions and 2 deletions

View File

@@ -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));
}

View File

@@ -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)));