Fix 2nd person conjugation in exp. timer messages

// FREEBIE
This commit is contained in:
2-4601 2016-10-06 17:39:32 +03:00 committed by lilia
parent f8a3ae158c
commit 81e1b84129
2 changed files with 24 additions and 12 deletions

View file

@ -347,9 +347,19 @@
"message": "Unblock this contact to send a message.", "message": "Unblock this contact to send a message.",
"description": "Brief message shown when trying to message a blocked number" "description": "Brief message shown when trying to message a blocked number"
}, },
"changedTheTimer": { "youChangedTheTimer": {
"message": "You set the timer to $time$.",
"description": "Message displayed when you change the message expiration timer in a conversation.",
"placeholders": {
"time": {
"content": "$1",
"example": "10m"
}
}
},
"theyChangedTheTimer": {
"message": "$name$ set the timer to $time$.", "message": "$name$ set the timer to $time$.",
"description": "Message displayed when someone changes the message expiration timer in a conversation.", "description": "Message displayed when someone else changes the message expiration timer in a conversation.",
"placeholders": { "placeholders": {
"name": { "name": {
"content": "$1", "content": "$1",
@ -447,10 +457,6 @@
} }
} }
}, },
"you": {
"message": "You",
"description": "A gender-neutral second-person prounoun used as a subject, as in, 'You set the timer to 5 seconds'"
},
"safetyNumbersSettingHeader": { "safetyNumbersSettingHeader": {
"message": "Safety numbers approval", "message": "Safety numbers approval",
"description": "Description for safety numbers setting" "description": "Description for safety numbers setting"

View file

@ -56,14 +56,20 @@
}, },
render_attributes: function() { render_attributes: function() {
var seconds = this.model.get('expirationTimerUpdate').expireTimer; var seconds = this.model.get('expirationTimerUpdate').expireTimer;
var name = this.conversation.getTitle(); var timerMessage;
if (this.conversation.id === textsecure.storage.user.getNumber()) { if (this.conversation.id === textsecure.storage.user.getNumber()) {
name = i18n('you'); timerMessage = {
content: i18n('youChangedTheTimer',
Whisper.ExpirationTimerOptions.getName(seconds))
};
} else {
timerMessage = {
content: i18n('theyChangedTheTimer', [
this.conversation.getTitle(),
Whisper.ExpirationTimerOptions.getName(seconds)])
};
} }
return { return timerMessage;
content: i18n('changedTheTimer', [name,
Whisper.ExpirationTimerOptions.getName(seconds)])
};
} }
}); });