From cd91bc3d71b5a6d37dc2695d76cabf575a565f2f Mon Sep 17 00:00:00 2001 From: CIC4DA Date: Fri, 5 Jan 2024 19:54:57 +0530 Subject: [PATCH] compose_ui: Use Intl.ListFormat rather than .join(", ") --- web/src/compose_ui.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/compose_ui.js b/web/src/compose_ui.js index 83f1b51f62..d59843495a 100644 --- a/web/src/compose_ui.js +++ b/web/src/compose_ui.js @@ -14,8 +14,8 @@ import * as people from "./people"; import * as popover_menus from "./popover_menus"; import * as rtl from "./rtl"; import * as stream_data from "./stream_data"; -import {user_settings} from "./user_settings"; import * as user_status from "./user_status"; +import * as util from "./util"; export let compose_spinner_visible = false; export let shift_pressed = false; // true or false @@ -259,9 +259,7 @@ export function compute_placeholder_text(opts) { } return user.full_name; }); - const recipient_names = Intl.ListFormat - ? new Intl.ListFormat(user_settings.default_language).format(recipient_parts) - : recipient_parts.join(", "); + const recipient_names = util.format_array_as_list(recipient_parts, "long", "conjunction"); if (recipient_list.length === 1) { // If it's a single user, display status text if available