From 70bf9914b26d1fe66197b188c083baa541bf0e5a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 12 Apr 2021 16:47:27 -0700 Subject: [PATCH] message_list: Convert bookend_content messages to FormatJS. Signed-off-by: Anders Kaseorg --- static/js/message_list.js | 13 ++++++++----- static/templates/bookend.hbs | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/static/js/message_list.js b/static/js/message_list.js index db9461e53a..2c916a41aa 100644 --- a/static/js/message_list.js +++ b/static/js/message_list.js @@ -2,7 +2,7 @@ import autosize from "autosize"; import $ from "jquery"; import * as blueslip from "./blueslip"; -import {i18n} from "./i18n"; +import {$t} from "./i18n"; import {MessageListData} from "./message_list_data"; import {MessageListView} from "./message_list_view"; import * as narrow_banner from "./narrow_banner"; @@ -232,19 +232,22 @@ export class MessageList { } subscribed_bookend_content(stream_name) { - return i18n.t("You subscribed to stream __stream__", {stream: stream_name}); + return $t({defaultMessage: "You subscribed to stream {stream}"}, {stream: stream_name}); } unsubscribed_bookend_content(stream_name) { - return i18n.t("You unsubscribed from stream __stream__", {stream: stream_name}); + return $t({defaultMessage: "You unsubscribed from stream {stream}"}, {stream: stream_name}); } not_subscribed_bookend_content(stream_name) { - return i18n.t("You are not subscribed to stream __stream__", {stream: stream_name}); + return $t( + {defaultMessage: "You are not subscribed to stream {stream}"}, + {stream: stream_name}, + ); } deactivated_bookend_content() { - return i18n.t("This stream has been deactivated"); + return $t({defaultMessage: "This stream has been deactivated"}); } // Maintains a trailing bookend element explaining any changes in diff --git a/static/templates/bookend.hbs b/static/templates/bookend.hbs index a98ead0241..6ddbfa932b 100644 --- a/static/templates/bookend.hbs +++ b/static/templates/bookend.hbs @@ -2,7 +2,7 @@ {{#if bookend_content}}
- {{{bookend_content}}} + {{bookend_content}} {{#if trailing}}