From 24f3763836cd95fffd48738129896fa6bdf7af3d Mon Sep 17 00:00:00 2001 From: Lilia Date: Tue, 10 Oct 2017 17:49:12 +0200 Subject: [PATCH] i18n group updates (#1549) // FREEBIE --- _locales/en/messages.json | 34 ++++++++++++++++++++++++++++++++++ js/models/messages.js | 8 ++++---- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 38b9d3018935..e9f2af36eea3 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -847,5 +847,39 @@ }, "autoUpdateLaterButtonLabel": { "message": "Later" + }, + "leftTheGroup": { + "message": "$name$ left the group.", + "description": "Shown in the conversation history when someone leaves the group", + "placeholders": { + "name": { + "content": "$1", + "example": "Bob" + } + } + }, + "updatedTheGroup": { + "message": "Updated the group.", + "description": "Shown in the conversation history when someone updates the group" + }, + "titleIsNow": { + "message": "Title is now '$name$'.", + "description": "Shown in the conversation history when someone changes the title of the group", + "placeholders": { + "name": { + "content": "$1", + "example": "Book Club" + } + } + }, + "joinedTheGroup": { + "message": "$names$ joined the group.", + "description": "Shown in the conversation history when people join the group", + "placeholders": { + "names": { + "content": "$1", + "example": "Alice, Bob" + } + } } } diff --git a/js/models/messages.js b/js/models/messages.js index 6de9667513a1..89c8cc297fb6 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -76,15 +76,15 @@ if (this.isGroupUpdate()) { var group_update = this.get('group_update'); if (group_update.left) { - return group_update.left + ' left the group.'; + return i18n('leftTheGroup', group_update.left); } - var messages = ['Updated the group.']; + var messages = [i18n('updatedTheGroup')]; if (group_update.name) { - messages.push("Title is now '" + group_update.name + "'."); + messages.push(i18n('titleIsNow', group_update.name)); } if (group_update.joined) { - messages.push(group_update.joined.join(', ') + ' joined the group.'); + messages.push(i18n('joinedTheGroup', group_update.joined.join(', '))); } return messages.join(' ');