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.

settings: Present language notification in template.

Karl Stolleyc2256809e4a1
diff --git a/web/src/settings_preferences.ts b/web/src/settings_preferences.ts
index 021301f5694..f9e05fac3b3 100644
--- a/web/src/settings_preferences.ts
+++ b/web/src/settings_preferences.ts
@@ -5,6 +5,7 @@ import type * as tippy from "tippy.js";
import * as z from "zod/mini";
import render_dialog_default_language from "../templates/default_language_modal.hbs";
+import render_confirm_language_change from "../templates/settings/confirm_language_change.hbs";
import * as channel from "./channel.ts";
import * as dialog_widget from "./dialog_widget.ts";
@@ -395,20 +396,13 @@ function language_select_callback(
const current_value = widget.current_value;
assert(current_value !== undefined);
const data = {default_language: current_value};
+ const language_select_message_html = render_confirm_language_change();
change_display_setting(
data,
$("#user-preferences").find(".general-settings-status"),
undefined,
undefined,
- $t_html(
- {
- defaultMessage:
- "Saved. Please <z-link>reload</z-link> for the change to take effect.",
- },
- {
- "z-link": (content_html) => `<a class='reload_link'>${content_html.join("")}</a>`,
- },
- ),
+ language_select_message_html,
true,
);
}
diff --git a/web/styles/settings.css b/web/styles/settings.css
index 7b202a2ea47..0e5328d77d0 100644
--- a/web/styles/settings.css
+++ b/web/styles/settings.css
@@ -792,6 +792,12 @@ input[type="checkbox"] {
vertical-align: top;
}
+ .alert-notification-content {
+ /* Push back against inherited value, which
+ is not relevant in this DOM element. */
+ white-space: normal;
+ }
+
& img {
margin-right: 6px;
}
diff --git a/web/templates/settings/confirm_language_change.hbs b/web/templates/settings/confirm_language_change.hbs
new file mode 100644
index 00000000000..88ad2cf9e67
--- /dev/null
+++ b/web/templates/settings/confirm_language_change.hbs
@@ -0,0 +1,7 @@
+<div class="alert-notification-content">
+ {{#tr}}
+ Saved. Please <z-link>reload</z-link> for the change to take effect.
+
+ {{#*inline "z-link"}}<a class="reload_link">{{> @partial-block}}</a>{{/inline}}
+ {{/tr}}
+</div>