Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_pill: Update `format_stream_name_and_subscriber_count`.

sanchi-t445ff79e10c0
diff --git a/web/src/stream_pill.ts b/web/src/stream_pill.ts
index 551cc2ec09a..88678b54169 100644
--- a/web/src/stream_pill.ts
+++ b/web/src/stream_pill.ts
@@ -1,3 +1,4 @@
+import {$t} from "./i18n";
import type {InputPillContainer, InputPillItem} from "./input_pill";
import * as peer_data from "./peer_data";
import * as stream_data from "./stream_data";
@@ -16,7 +17,10 @@ export type StreamPillData = StreamSubscription & {type: "stream"};
function format_stream_name_and_subscriber_count(sub: StreamSubscription): string {
const sub_count = peer_data.get_subscriber_count(sub.stream_id);
- return "#" + sub.name +": " + sub_count + " users";
+ return $t(
+ {defaultMessage: "#{stream_name}: {sub_count} users"},
+ {stream_name: sub.name, sub_count},
+ );
}
export function create_item_from_stream_name(
diff --git a/web/tests/stream_pill.test.js b/web/tests/stream_pill.test.js
index 42774421d99..6b4343baf32 100644
--- a/web/tests/stream_pill.test.js
+++ b/web/tests/stream_pill.test.js
@@ -33,7 +33,7 @@ const sweden_pill = {
stream_name: sweden.name,
stream_id: sweden.stream_id,
type: "stream",
- display_value: "#Sweden: 5 users",
+ display_value: "translated: #Sweden: 5 users",
};
const subs = [denmark, sweden];