Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
i18n: Convert Handlebars messages to FormatJS.
Anders Kaseorg0892e98012f2
diff --git a/static/js/templates.js b/static/js/templates.jsindex c66d0596281..c69ea242b4e 100644--- a/static/js/templates.js+++ b/static/js/templates.js@@ -1,6 +1,6 @@import Handlebars from "handlebars/runtime";-import {i18n} from "./i18n";+import {default_html_elements, intl} from "./i18n";import * as util from "./util";// Below, we register Zulip-specific extensions to the handlebars API.@@ -50,29 +50,16 @@ Handlebars.registerHelper({},});-// Note that this i18n caching strategy does not allow us to support-// live-updating the UI language without reloading the Zulip browser-// window. That constraint would be very hard to change in any case,-// though, because of how Zulip renders some strings using the backend-// Jinja2 templating engine, so we don't consider this important.-const t_cache = new Map();--Handlebars.registerHelper("t", (i18n_key) => {+Handlebars.registerHelper("t", (message) => {// Marks a string for translation.// Example usage:// {{t "some English text"}}- const cache_result = t_cache.get(i18n_key);- if (cache_result !== undefined) {- return cache_result;- }- const result = i18n.t(i18n_key);- const safe_result = new Handlebars.SafeString(result);- t_cache.set(i18n_key, safe_result);- return safe_result;+ const descriptor = {id: message, defaultMessage: message};+ return intl.formatMessage(descriptor);});-Handlebars.registerHelper("tr", (context, options) => {+Handlebars.registerHelper("tr", function (context, options) {// Marks a block for translation.// Example usage 1:// {{#tr context}}@@ -81,22 +68,36 @@ Handlebars.registerHelper("tr", (context, options) => {//// Example usage 2:// {{#tr context}}- // <p>This __variable__ will get value from context</p>+ // <p>This {variable} will get value from context</p>// {{/tr}}//// Notes:// 1. `context` is very important. It can be `this` or an// object or key of the current context.- // 2. Use `__` instead of `{{` and `}}` to declare expressions- const result = i18n.t(- options- .fn(context)- .trim()- .split("\n")- .map((s) => s.trim())- .join(" "),- context,- );+ // 2. Use `{` and `}` instead of `{{` and `}}` to declare+ // expressions.+ const message = options+ .fn(context)+ .trim()+ .split("\n")+ .map((s) => s.trim())+ .join(" ");+ const descriptor = {id: message, defaultMessage: message};+ const result = intl.formatMessage(descriptor, {+ ...default_html_elements,+ ...Object.fromEntries(+ Object.entries(options.fn.partials ?? {}).map(([name, value]) => [+ name,+ (s) => value(this, {data: {"partial-block": () => s.join("")}}),+ ]),+ ),+ ...Object.fromEntries(+ Object.entries(context ?? {}).map(([key, value]) => [+ key,+ Handlebars.Utils.escapeExpression(value),+ ]),+ ),+ });return new Handlebars.SafeString(result);});diff --git a/static/templates/actions_popover_content.hbs b/static/templates/actions_popover_content.hbsindex 3118522bef5..cb456b6584b 100644--- a/static/templates/actions_popover_content.hbs+++ b/static/templates/actions_popover_content.hbs@@ -64,7 +64,7 @@<li><a href="#" class="popover_mute_topic" data-msg-stream-id="{{stream_id}}" data-msg-topic="{{topic}}"><i class="fa fa-bell-slash" aria-hidden="true"></i>- {{#tr this}}Mute the topic <b>__topic__</b>{{/tr}} <span class="hotkey-hint">(M)</span>+ {{#tr this}}Mute the topic <b>{topic}</b>{{/tr}} <span class="hotkey-hint">(M)</span></a></li>{{/if}}@@ -73,7 +73,7 @@<li><a href="#" class="popover_unmute_topic" data-msg-stream-id="{{stream_id}}" data-msg-topic="{{topic}}"><i class="fa fa-bell" aria-hidden="true"></i>- {{#tr this}}Unmute the topic <b>__topic__</b>{{/tr}}+ {{#tr this}}Unmute the topic <b>{topic}</b>{{/tr}}</a></li>{{/if}}diff --git a/static/templates/announce_stream_docs.hbs b/static/templates/announce_stream_docs.hbsindex 63e84d4ab81..f456d79e408 100644--- a/static/templates/announce_stream_docs.hbs+++ b/static/templates/announce_stream_docs.hbs@@ -2,7 +2,7 @@<div>{{#tr this}}- <p>Stream will be announced in <b>#__notifications_stream__</b>.</p>+ <p>Stream will be announced in <b>#{notifications_stream}</b>.</p>{{/tr}}<p>{{t 'Organization administrators can change this in the organization settings.' }}</p>diff --git a/static/templates/archive_recipient_row.hbs b/static/templates/archive_recipient_row.hbsindex cc09e90f120..3a63c24585a 100644--- a/static/templates/archive_recipient_row.hbs+++ b/static/templates/archive_recipient_row.hbs@@ -5,7 +5,7 @@<a class="message_label_clickable narrows_by_recipient stream_label {{color_class}}"style="background: {{background_color}}; border-left-color: {{background_color}};"href="{{stream_url}}"- title="{{#tr this}}Narrow to stream "__display_recipient__"{{/tr}}">+ title="{{#tr this}}Narrow to stream "{display_recipient}"{{/tr}}">{{display_recipient}}</a>{{! topic stuff }}@@ -13,7 +13,7 @@{{! topic link }}<a class="message_label_clickable narrows_by_topic"href="{{topic_url}}"- title="{{#tr this}}Narrow to stream "__display_recipient__", topic "__topic__"{{/tr}}">+ title="{{#tr this}}Narrow to stream "{display_recipient}", topic "{topic}"{{/tr}}">{{topic}}</a></span>diff --git a/static/templates/compose_all_everyone.hbs b/static/templates/compose_all_everyone.hbsindex d08c050e2aa..5d282b485e3 100644--- a/static/templates/compose_all_everyone.hbs+++ b/static/templates/compose_all_everyone.hbs@@ -1,11 +1,11 @@<div class="compose-all-everyone"><span class="compose-all-everyone-msg">{{#tr this}}- Are you sure you want to mention all <strong>__count__</strong> people in this stream?+ Are you sure you want to mention all <strong>{count}</strong> people in this stream?<br>- This will send email and mobile push notifications to most of those <strong>__count__</strong> users.+ This will send email and mobile push notifications to most of those <strong>{count}</strong> users.<br>- If you don't want to do that, please edit your message to remove the <strong>@__mention__</strong> mention.+ If you don't want to do that, please edit your message to remove the <strong>@{mention}</strong> mention.{{/tr}}</span><span class="compose-all-everyone-controls">diff --git a/static/templates/compose_announce.hbs b/static/templates/compose_announce.hbsindex 133828b032b..7dd0a4a1fab 100644--- a/static/templates/compose_announce.hbs+++ b/static/templates/compose_announce.hbs@@ -3,7 +3,7 @@{{#tr this}}This stream is reserved for <strong>announcements</strong>.<br>- Are you sure you want to message all <strong>__count__</strong> people in this stream?+ Are you sure you want to message all <strong>{count}</strong> people in this stream?{{/tr}}</span><span class="compose-announce-controls">diff --git a/static/templates/compose_invite_users.hbs b/static/templates/compose_invite_users.hbsindex 94a722f03e8..85f34565e99 100644--- a/static/templates/compose_invite_users.hbs+++ b/static/templates/compose_invite_users.hbs@@ -1,10 +1,10 @@<div class="compose_invite_user" data-user-id="{{user_id}}" data-stream-id="{{stream_id}}">{{#if can_subscribe_other_users}}- <p>{{#tr this}}<strong>__name__</strong> is not subscribed to this stream. They will not be notified unless you subscribe them.{{/tr}}</p>+ <p>{{#tr this}}<strong>{name}</strong> is not subscribed to this stream. They will not be notified unless you subscribe them.{{/tr}}</p><div class="compose_invite_user_controls"><button class="btn btn-warning compose_invite_link" >{{t "Subscribe" }}</button><button type="button" class="compose_invite_close close">×</button></div>{{else}}- <p>{{#tr this}}<strong>__name__</strong> is not subscribed to this stream. They will not be notified if you mention them.{{/tr}}</p>+ <p>{{#tr this}}<strong>{name}</strong> is not subscribed to this stream. They will not be notified if you mention them.{{/tr}}</p>{{/if}}</div>diff --git a/static/templates/compose_private_stream_alert.hbs b/static/templates/compose_private_stream_alert.hbsindex 1981fcf2495..cef115efe4f 100644--- a/static/templates/compose_private_stream_alert.hbs+++ b/static/templates/compose_private_stream_alert.hbs@@ -1,5 +1,5 @@<div class="compose_private_stream_alert" data-stream_name="{{stream_name}}">- <span>{{#tr this}}Warning: <strong>__stream_name__</strong> is a private stream.{{/tr}}</span>+ <span>{{#tr this}}Warning: <strong>{stream_name}</strong> is a private stream.{{/tr}}</span><div class="compose_private_stream_alert_controls"><button type="button" class="compose_private_stream_alert_close close">×</button></div>diff --git a/static/templates/confirm_delete_user.hbs b/static/templates/confirm_delete_user.hbsindex 10212391927..89a38219476 100644--- a/static/templates/confirm_delete_user.hbs+++ b/static/templates/confirm_delete_user.hbs@@ -1,5 +1,5 @@<p>{{#tr this}}- Are you sure you want to delete <b>__group_name__</b>?+ Are you sure you want to delete <b>{group_name}</b>?{{/tr}}</p>diff --git a/static/templates/confirm_unstar_all_messages_in_topic.hbs b/static/templates/confirm_unstar_all_messages_in_topic.hbsindex b4b9c35a362..923e8219b89 100644--- a/static/templates/confirm_unstar_all_messages_in_topic.hbs+++ b/static/templates/confirm_unstar_all_messages_in_topic.hbs@@ -1,5 +1,5 @@<p>{{#tr this}}- Are you sure you want to unstar all messages in topic <b>__topic__</b>? This action cannot be undone.+ Are you sure you want to unstar all messages in topic <b>{topic}</b>? This action cannot be undone.{{/tr}}</p>diff --git a/static/templates/delete_topic_modal.hbs b/static/templates/delete_topic_modal.hbsindex f5e692ce7da..2aa178f6c44 100644--- a/static/templates/delete_topic_modal.hbs+++ b/static/templates/delete_topic_modal.hbs@@ -7,7 +7,7 @@</h3></div><div class="modal-body">- <p>{{#tr this}}Are you sure you want to permanently delete <b>__topic_name__</b>?{{/tr}}</p>+ <p>{{#tr this}}Are you sure you want to permanently delete <b>{topic_name}</b>?{{/tr}}</p><p>{{t "Deleting a topic will immediately remove it and its messages for everyone. Other users may find this confusing, especially if they had received an email or push notification related to the deleted messages." }}</p></div><div class="modal-footer">diff --git a/static/templates/draft.hbs b/static/templates/draft.hbsindex 8c979f4c867..ac4f2e63196 100644--- a/static/templates/draft.hbs+++ b/static/templates/draft.hbs@@ -20,7 +20,7 @@<div class="message_header message_header_private_message dark_background"><div class="message-header-contents"><div class="message_label_clickable stream_label">- {{#tr this}}You and __recipients__{{/tr}}+ {{#tr this}}You and {recipients}{{/tr}}</div><div class="recipient_row_date" title="{{t 'Last modified'}}">{{ time_stamp }}</div></div>diff --git a/static/templates/draft_table_body.hbs b/static/templates/draft_table_body.hbsindex cde69542abe..e573f6e0d9b 100644--- a/static/templates/draft_table_body.hbs+++ b/static/templates/draft_table_body.hbs@@ -7,7 +7,7 @@<span class="exit-sign">×</span></div><div class="removed-drafts">- {{#tr this}} Drafts older than <strong>__draft_lifetime__</strong> days are automatically removed. {{/tr}}+ {{#tr this}} Drafts older than <strong>{draft_lifetime}</strong> days are automatically removed. {{/tr}}</div><div class="draft-hotkey-reminder">{{t "Pro tip: You can use 'd' to open your drafts."}}diff --git a/static/templates/edited_notice.hbs b/static/templates/edited_notice.hbsindex 054b8888ceb..6eb7c43527d 100644--- a/static/templates/edited_notice.hbs+++ b/static/templates/edited_notice.hbs@@ -1,9 +1,9 @@{{#if msg/local_edit_timestamp}}-<div class="message_edit_notice auto-select" title="{{#tr this}}Edited (__last_edit_timestr__){{/tr}}">+<div class="message_edit_notice auto-select" title="{{#tr this}}Edited ({last_edit_timestr}){{/tr}}">({{t "SAVING" }})</div>{{else}}-<div class="message_edit_notice auto-select" title="{{#tr this}}Edited (__last_edit_timestr__){{/tr}}">+<div class="message_edit_notice auto-select" title="{{#tr this}}Edited ({last_edit_timestr}){{/tr}}">({{t "EDITED" }})</div>{{/if}}diff --git a/static/templates/invitation_failed_error.hbs b/static/templates/invitation_failed_error.hbsindex b41a8979394..6fd53b731b9 100644--- a/static/templates/invitation_failed_error.hbs+++ b/static/templates/invitation_failed_error.hbs@@ -6,7 +6,12 @@</ul>{{#if is_invitee_deactivated}}{{#if is_admin}}- <p id="invitation_admin_message">{{#tr this}}You can reactivate deactivated users from <a href="#organization/deactivated-users-admin">organization settings.</a>{{/tr}}</p>+ <p id="invitation_admin_message">+ {{#tr this}}+ You can reactivate deactivated users from <z-link>organization settings</z-link>.+ {{#*inline "z-link"}}<a href="#organization/deactivated-users-admin">{{> @partial-block}}</a>{{/inline}}+ {{/tr}}+ </p>{{else}}<p id="invitation_non_admin_message">{{t "Organization administrators can reactivate deactivated users." }}</p>{{/if}}diff --git a/static/templates/message_controls.hbs b/static/templates/message_controls.hbsindex 2b60479c05d..04c038f7ae4 100644--- a/static/templates/message_controls.hbs+++ b/static/templates/message_controls.hbs@@ -22,7 +22,7 @@{{#unless msg/locally_echoed}}<div class="star_container {{#if msg/starred}}{{else}}empty-star{{/if}}">- <i role="button" tabindex="0" class="star fa {{#if msg/starred}}fa-star{{else}}fa-star-o{{/if}}" title="{{#tr this.msg}}__starred_status__ this message{{/tr}} (Ctrl + s)"></i>+ <i role="button" tabindex="0" class="star fa {{#if msg/starred}}fa-star{{else}}fa-star-o{{/if}}" title="{{#tr this.msg}}{starred_status} this message{{/tr}} (Ctrl + s)"></i></div>{{/unless}}diff --git a/static/templates/message_edit_form.hbs b/static/templates/message_edit_form.hbsindex 5175ceee2ad..13a6166674b 100644--- a/static/templates/message_edit_form.hbs+++ b/static/templates/message_edit_form.hbs@@ -82,7 +82,7 @@{{#if has_been_editable}}<div class="message-edit-timer-control-group"><span class="message_edit_countdown_timer"></span>- <span><i id="message_edit_tooltip" class="tippy-zulip-tooltip message_edit_tooltip fa fa-question-circle" aria-hidden="true" data-tippy-content="{{#tr this}}This organization is configured to restrict editing of message content to __minutes_to_edit__ minutes after it is sent.{{/tr}}"></i>+ <span><i id="message_edit_tooltip" class="tippy-zulip-tooltip message_edit_tooltip fa fa-question-circle" aria-hidden="true" data-tippy-content="{{#tr this}}This organization is configured to restrict editing of message content to {minutes_to_edit} minutes after it is sent.{{/tr}}"></i></span></div>{{/if}}diff --git a/static/templates/move_topic_to_stream.hbs b/static/templates/move_topic_to_stream.hbsindex f2f47b0fe9a..81c9a6ef16f 100644--- a/static/templates/move_topic_to_stream.hbs+++ b/static/templates/move_topic_to_stream.hbs@@ -4,7 +4,7 @@<h3 id="move_topic_modal_label">{{t "Move topic" }} </h3></div><div class="modal-body">- <p>{{#tr this}}Move all messages in <strong>__topic_name__</strong>{{/tr}} to:</p>+ <p>{{#tr this}}Move all messages in <strong>{topic_name}</strong>{{/tr}} to:</p><form id="move_topic_form"><div id="topic_stream_edit_form_error" class="alert"><span class="send-status-close">×</span>diff --git a/static/templates/playground_links_popover_content.hbs b/static/templates/playground_links_popover_content.hbsindex 77a7d895c70..df93dcc12ac 100644--- a/static/templates/playground_links_popover_content.hbs+++ b/static/templates/playground_links_popover_content.hbs@@ -4,7 +4,7 @@<li><a href="{{this/playground_url}}" target="_blank" rel="noopener noreferrer" class="popover_playground_link">{{#tr this}}- View in __name__+ View in {name}{{/tr}}</a></li>diff --git a/static/templates/recipient_row.hbs b/static/templates/recipient_row.hbsindex b9cedae10c8..7f99a43c1b5 100644--- a/static/templates/recipient_row.hbs+++ b/static/templates/recipient_row.hbs@@ -6,7 +6,7 @@<a class="message_label_clickable narrows_by_recipient stream_label {{color_class}}"style="background: {{background_color}}; border-left-color: {{background_color}};"href="{{stream_url}}"- title="{{#tr this}}Narrow to stream "__display_recipient__"{{/tr}}">+ title="{{#tr this}}Narrow to stream "{display_recipient}"{{/tr}}">{{! invite only lock }}{{#if invite_only}}<i class="fa fa-lock invite-stream-icon" title="{{t 'This is a private stream' }}" aria-label="{{t 'This is a private stream' }}"></i>@@ -21,7 +21,7 @@{{! topic link }}<a class="message_label_clickable narrows_by_topic"href="{{topic_url}}"- title="{{#tr this}}Narrow to stream "__display_recipient__", topic "__topic__"{{/tr}}">+ title="{{#tr this}}Narrow to stream "{display_recipient}", topic "{topic}"{{/tr}}">{{#if use_match_properties}}{{{match_topic}}}{{else}}@@ -62,8 +62,8 @@<div class="message-header-contents"><a class="message_label_clickable narrows_by_recipient stream_label"href="{{pm_with_url}}"- title="{{#tr this}}Narrow to your private messages with __display_reply_to__{{/tr}}">- {{#tr this}}You and __display_reply_to__{{/tr}}+ title="{{#tr this}}Narrow to your private messages with {display_reply_to}{{/tr}}">+ {{#tr this}}You and {display_reply_to}{{/tr}}</a><span class="recipient_row_date {{#if group_date_divider_html}}{{else}}hide-date{{/if}}">{{{date}}}</span>diff --git a/static/templates/settings/account_settings.hbs b/static/templates/settings/account_settings.hbsindex 1756728959f..6e83e7ddcc8 100644--- a/static/templates/settings/account_settings.hbs+++ b/static/templates/settings/account_settings.hbs@@ -195,7 +195,7 @@An API key can be used to programmatically access a Zulip account.Anyone with access to your API key has the ability to read your messages, sendmessages on your behalf, and otherwise impersonate you on Zulip, so you should- guard your API key as carefully as you guard your password. <br>+ guard your API key as carefully as you guard your password. <br />We recommend creating bots and using the bots' accounts and API keys to accessthe Zulip API, unless the task requires access to your account.{{/tr}}diff --git a/static/templates/settings/bot_settings.hbs b/static/templates/settings/bot_settings.hbsindex 3d91208f5f7..85180b59af9 100644--- a/static/templates/settings/bot_settings.hbs+++ b/static/templates/settings/bot_settings.hbs@@ -2,7 +2,11 @@<div class="bot-settings-form">{{#unless page_params.is_guest}}<div class="tip">- {{#tr this}}Looking for our <a href="/integrations" target="_blank" rel="noopener noreferrer">Integrations</a> or <a href="/api" rel="noopener noreferrer" target="_blank">API</a> documentation?{{/tr}}+ {{#tr this}}+ Looking for our <z-integrations>integrations</z-integrations> or <z-api>API</z-api> documentation?+ {{#*inline "z-integrations"}}<a href="/integrations" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}+ {{#*inline "z-api"}}<a href="/api" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}+ {{/tr}}</div><div class="tip bot-settings-tip"></div>diff --git a/static/templates/settings/data_exports_admin.hbs b/static/templates/settings/data_exports_admin.hbsindex 450db1e03c2..968bcb288c7 100644--- a/static/templates/settings/data_exports_admin.hbs+++ b/static/templates/settings/data_exports_admin.hbs@@ -8,7 +8,10 @@{{t 'Depending on the size of your organization, an export can take anywhere from seconds to an hour.' }}</p><p>- {{#tr this}}<a href="/help/export-your-organization" target="_blank" rel="noopener noreferrer">Click here</a> to learn about exporting private streams and messages.{{/tr}}+ {{#tr this}}+ <z-link>Click here</z-link> to learn about exporting private streams and messages.+ {{#*inline "z-link"}}<a href="/help/export-your-organization" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}+ {{/tr}}{{t 'Note that organizations are limited to five exports per week.' }}</p>diff --git a/static/templates/settings/deactivation_user_modal.hbs b/static/templates/settings/deactivation_user_modal.hbsindex 9f19ae6e0af..ac606a60109 100644--- a/static/templates/settings/deactivation_user_modal.hbs+++ b/static/templates/settings/deactivation_user_modal.hbs@@ -4,7 +4,12 @@<h3 id="deactivation_user_modal_label">{{t "Deactivate" }} <span class="email"></span></h3></div><div class="modal-body">- <p>{{#tr this}}By deactivating <strong><span class="user_name"></span></strong> <<span class="email"></span>>, they will be logged out immediately.{{/tr}}</p>+ <p>+ {{#tr this}}+ By deactivating <z-user></z-user>, they will be logged out immediately.+ {{#*inline "z-user"}}<strong><span class="user_name"></span></strong> <<span class="email"></span>>{{/inline}}+ {{/tr}}+ </p><p>{{t "Their password will be cleared from our systems, and any bots they maintain will be disabled." }}</p></div><div class="modal-footer">diff --git a/static/templates/settings/emoji_settings_admin.hbs b/static/templates/settings/emoji_settings_admin.hbsindex e4c6a910c35..12f9bb4aabd 100644--- a/static/templates/settings/emoji_settings_admin.hbs+++ b/static/templates/settings/emoji_settings_admin.hbs@@ -3,7 +3,7 @@{{> emoji_settings_tip}}</div><p class="add-emoji-text {{#unless can_add_emojis}}hide{{/unless}}">- {{#tr this}}Add extra emoji for members of the __realm_name__ organization.{{/tr}}+ {{#tr this}}Add extra emoji for members of the {realm_name} organization.{{/tr}}</p><form class="form-horizontal admin-emoji-form {{#unless can_add_emojis}}hide{{/unless}}"><div class="add-new-emoji-box grey-box">diff --git a/static/templates/settings/linkifier_settings_admin.hbs b/static/templates/settings/linkifier_settings_admin.hbsindex 1a9693d2037..f1eb8098fc8 100644--- a/static/templates/settings/linkifier_settings_admin.hbs+++ b/static/templates/settings/linkifier_settings_admin.hbs@@ -36,7 +36,8 @@</ul><p>{{#tr this}}- More details are available <a href="/help/add-a-custom-linkifier" target="_blank" rel="noopener noreferrer">in the Help Center article</a>.+ More details are available <z-link>in the Help Center article</z-link>.+ {{#*inline "z-link"}}<a href="/help/add-a-custom-linkifier" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}{{/tr}}</p>diff --git a/static/templates/settings/resend_invite_modal.hbs b/static/templates/settings/resend_invite_modal.hbsindex 0795f7c040d..09356d06811 100644--- a/static/templates/settings/resend_invite_modal.hbs+++ b/static/templates/settings/resend_invite_modal.hbs@@ -1,10 +1,20 @@<div id="resend_invite_modal" class="modal modal-bg hide fade" tabindex="-1" role="dialog" aria-labelledby="resend_invite_modal_label" aria-hidden="true"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="{{t 'Close' }}"><span aria-hidden="true">×</span></button>- <h3 id="resend_invite_modal_label">{{#tr this}}Resend invitation to <span class="email"></span>{{/tr}}</h3>+ <h3 id="resend_invite_modal_label">+ {{#tr this}}+ Resend invitation to <z-email></z-email>+ {{#*inline "z-email"}}<span class="email"></span>{{/inline}}+ {{/tr}}+ </h3></div><div class="modal-body">- <p>{{#tr this}}Are you sure you want to resend the invitation to <strong><span class="email"></span></strong>?{{/tr}}</p>+ <p>+ {{#tr this}}+ Are you sure you want to resend the invitation to <z-email></z-email>?+ {{#*inline "z-email"}}<strong><span class="email"></span></strong>{{/inline}}+ {{/tr}}+ </p></div><div class="modal-footer"><button class="button rounded" data-dismiss="modal">{{t "Cancel" }}</button>diff --git a/static/templates/settings/revoke_invite_modal.hbs b/static/templates/settings/revoke_invite_modal.hbsindex b174be6d88e..2adc66c6b19 100644--- a/static/templates/settings/revoke_invite_modal.hbs+++ b/static/templates/settings/revoke_invite_modal.hbs@@ -4,14 +4,14 @@{{#if is_multiuse}}<h3 id="revoke_invite_modal_label">{{#tr this}}Revoke invitation link{{/tr}}</h3>{{else}}- <h3 id="revoke_invite_modal_label">{{#tr this}}Revoke invitation to __email__{{/tr}}</h3>+ <h3 id="revoke_invite_modal_label">{{#tr this}}Revoke invitation to {email}{{/tr}}</h3>{{/if}}</div><div class="modal-body" id="revoke_invite_message">{{#if is_multiuse}}- <p>{{#tr this}}Are you sure you want to revoke this invitation link created by <strong>__referred_by__</strong>?{{/tr}}</p>+ <p>{{#tr this}}Are you sure you want to revoke this invitation link created by <strong>{referred_by}</strong>?{{/tr}}</p>{{else}}- <p>{{#tr this}}Are you sure you want to revoke the invitation to <strong>__email__</strong>?{{/tr}}</p>+ <p>{{#tr this}}Are you sure you want to revoke the invitation to <strong>{email}</strong>?{{/tr}}</p>{{/if}}</div><div class="modal-footer">diff --git a/static/templates/settings/upload_space_stats.hbs b/static/templates/settings/upload_space_stats.hbsindex 3a2772312e0..b0122a66fc8 100644--- a/static/templates/settings/upload_space_stats.hbs+++ b/static/templates/settings/upload_space_stats.hbs@@ -1,4 +1,9 @@<span>- {{#tr this}}Organization using __percent_used__% of __upload_quota__.{{/tr}}- {{#if show_upgrade_message}}{{#tr this}}<a href="/upgrade" target="_blank" rel="noopener noreferrer">Upgrade</a> for more space.{{/tr}}{{/if}}+ {{#tr this}}Organization using {percent_used}% of {upload_quota}.{{/tr}}+ {{#if show_upgrade_message}}+ {{#tr this}}+ <z-link>Upgrade</z-link> for more space.+ {{#*inline "z-link"}}<a href="/upgrade" target="_blank" rel="noopener noreferrer">{{> @partial-block }}</a>{{/inline}}+ {{/tr}}+ {{/if}}</span>diff --git a/static/templates/stream_creation_form.hbs b/static/templates/stream_creation_form.hbsindex b14556d38f2..cbef09ce19d 100644--- a/static/templates/stream_creation_form.hbs+++ b/static/templates/stream_creation_form.hbs@@ -24,7 +24,10 @@{{t "Stream permissions" }}</div><div class="stream-creation-info">- {{t 'These settings are explained in detail in the <a target="_blank" rel="noopener noreferrer" href="/help/stream-permissions">help center</a>.'}}+ {{#tr this}}+ These settings are explained in detail in the <z-link>help center</z-link>.+ {{#*inline "z-link"}}<a target="_blank" rel="noopener noreferrer" href="/help/stream-permissions">{{> @partial-block }}</a>{{/inline}}+ {{/tr}}</div>{{> stream_typesdiff --git a/static/templates/subscription_invites_warning_modal.hbs b/static/templates/subscription_invites_warning_modal.hbsindex 1d3b07bbb80..76a640b4a10 100644--- a/static/templates/subscription_invites_warning_modal.hbs+++ b/static/templates/subscription_invites_warning_modal.hbs@@ -5,11 +5,11 @@<h3 id="invites-warning-label">{{t "Large number of subscribers" }}</h3></div><div class="modal-body">- <p>{{#tr this}}Are you sure you want to create stream '__stream_name__' and subscribe __count__ users to it?{{/tr}}</p>+ <p>{{#tr this}}Are you sure you want to create stream ''''{stream_name}'''' and subscribe {count} users to it?{{/tr}}</p></div><div class="modal-footer"><button class="btn btn-default close-invites-warning-modal">{{t "Go back" }}</button>- <button class="btn btn-warning confirm-invites-warning-modal">{{#tr this}}Yes, subscribe __count__ users!{{/tr}}</button>+ <button class="btn btn-warning confirm-invites-warning-modal">{{#tr this}}Yes, subscribe {count} users!{{/tr}}</button></div></div></div>diff --git a/static/templates/subscription_table_body.hbs b/static/templates/subscription_table_body.hbsindex 7a545825f3b..b756f79e805 100644--- a/static/templates/subscription_table_body.hbs+++ b/static/templates/subscription_table_body.hbs@@ -36,7 +36,12 @@<div class="nothing-selected">{{#if can_create_streams}}<button type="button" class="create_stream_button button small rounded sea-green">{{t 'Create stream' }}</button>- <span>{{t 'First time? Read our <a href="/help/getting-your-organization-started-with-zulip#create-streams" target="_blank" rel="noopener noreferrer">guidelines</a> for creating and naming streams.' }}</span>+ <span>+ {{#tr this}}+ First time? Read our <z-link>guidelines</z-link> for creating and naming streams.+ {{#*inline "z-link"}}<a href="/help/getting-your-organization-started-with-zulip#create-streams" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}+ {{/tr}}+ </span>{{/if}}</div><div class="settings" data-simplebar data-simplebar-auto-hide="false">diff --git a/static/templates/subscription_type.hbs b/static/templates/subscription_type.hbsindex 63b906f9739..f7eb5c7d2be 100644--- a/static/templates/subscription_type.hbs+++ b/static/templates/subscription_type.hbs@@ -1,12 +1,21 @@{{#if invite_only}}- {{t 'This is a <span class="fa fa-lock" aria-hidden="true"></span> <b>private stream</b>. Only people who have been invited can access its content, but any member of the stream can invite others.' }}+ {{#tr this}}+ This is a <z-icon></z-icon> <b>private stream</b>. Only people who have been invited can access its content, but any member of the stream can invite others.+ {{#*inline "z-icon"}}<span class="fa fa-lock" aria-hidden="true"></span>{{/inline}}+ {{/tr}}{{#if history_public_to_subscribers}}{{t 'New members can view complete message history.' }}{{else}}{{t 'New members can only see messages sent after they join.' }}{{/if}}{{else if is_web_public}}- {{t 'This is a <i class="fa fa-globe" aria-hidden="true"></i> <b>web public stream</b>. Any member of the organization can join without an invitation and anyone on the internet can read the content published.'}}+ {{#tr this}}+ This is a <z-icon></z-icon> <b>web public stream</b>. Any member of the organization can join without an invitation and anyone on the internet can read the content published.+ {{#*inline "z-icon"}}<i class="fa fa-globe" aria-hidden="true"></i>{{/inline}}+ {{/tr}}{{else}}- {{t 'This is a <i class="hash" aria-hidden="true"></i> <b>public stream</b>. Any member of the organization can join without an invitation.' }}+ {{#tr this}}+ This is a <z-icon></z-icon> <b>public stream</b>. Any member of the organization can join without an invitation.+ {{#*inline "z-icon"}}<i class="hash" aria-hidden="true"></i>{{/inline}}+ {{/tr}}{{/if}}{{#if (eq stream_post_policy stream_post_policy_values.admins.code)}}{{t 'Only organization administrators can post.'}}diff --git a/static/templates/topic_muted.hbs b/static/templates/topic_muted.hbsindex dea819b7789..a9e372f9fcf 100644--- a/static/templates/topic_muted.hbs+++ b/static/templates/topic_muted.hbs@@ -1 +1,4 @@-{{#tr this}}You have muted <strong><span class="stream"></span> > <span class="topic"></span></strong>.{{/tr}}+{{#tr this}}+ You have muted <z-stream-topic></z-stream-topic>.+ {{#*inline "z-stream-topic"}}<strong><span class="stream"></span> > <span class="topic"></span></strong>{{/inline}}+{{/tr}}diff --git a/static/templates/typing_notification.hbs b/static/templates/typing_notification.hbsindex 97eb15fa657..c1fcb228977 100644--- a/static/templates/typing_notification.hbs+++ b/static/templates/typing_notification.hbs@@ -1 +1 @@-<li data-email="{{this.email}}" class="typing_notification">{{#tr this}}__full_name__ is typing…{{/tr}}</li>+<li data-email="{{this.email}}" class="typing_notification">{{#tr this}}{full_name} is typing…{{/tr}}</li>diff --git a/static/templates/user_groups_admin.hbs b/static/templates/user_groups_admin.hbsindex be51b0853ba..f7c0558a159 100644--- a/static/templates/user_groups_admin.hbs+++ b/static/templates/user_groups_admin.hbs@@ -9,7 +9,10 @@{{#unless is_guest}}<p>- {{#tr this}}User groups allow you to <a href="/help/mention-a-user-or-group" target="_blank" rel="noopener noreferrer">mention</a> multiple users at once. When you mention a user group, everyone in the group is notified as if they were individually mentioned.{{/tr}}+ {{#tr this}}+ User groups allow you to <z-link>mention</z-link> multiple users at once. When you mention a user group, everyone in the group is notified as if they were individually mentioned.+ {{#*inline "z-link"}}<a href="/help/mention-a-user-or-group" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}+ {{/tr}}</p>{{#if (or is_admin (eq realm_user_group_edit_policy USER_GROUP_EDIT_POLICY_MEMBERS))}}<form class="form-horizontal admin-user-group-form">