Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
i18n: Add translation mapping to EMOJI_CATEGORIES.
kash210453e173b54be5
diff --git a/web/src/emoji_picker.ts b/web/src/emoji_picker.tsindex 9ec78c95021..0a2d58d0414 100644--- a/web/src/emoji_picker.ts+++ b/web/src/emoji_picker.ts@@ -15,6 +15,7 @@ import * as compose_ui from "./compose_ui.ts";import * as composebox_typeahead from "./composebox_typeahead.ts";import * as emoji from "./emoji.ts";import type {EmojiDict} from "./emoji.ts";+import {$t} from "./i18n.ts";import * as keydown_util from "./keydown_util.ts";import * as message_store from "./message_store.ts";import {page_params} from "./page_params.ts";@@ -57,17 +58,29 @@ let edit_message_id: number | null = null;let current_message_id: number | null = null;const EMOJI_CATEGORIES = [- {name: "Popular", icon: "fa-star-o"},- {name: "Smileys & Emotion", icon: "fa-smile-o"},- {name: "People & Body", icon: "fa-thumbs-o-up"},- {name: "Animals & Nature", icon: "fa-leaf"},- {name: "Food & Drink", icon: "fa-cutlery"},- {name: "Activities", icon: "fa-soccer-ball-o"},- {name: "Travel & Places", icon: "fa-car"},- {name: "Objects", icon: "fa-lightbulb-o"},- {name: "Symbols", icon: "fa-hashtag"},- {name: "Flags", icon: "fa-flag"},- {name: "Custom", icon: "fa-cog"},+ {name: "Popular", icon: "fa-star-o", translated: $t({defaultMessage: "Popular"})},+ {+ name: "Smileys & Emotion",+ icon: "fa-smile-o",+ translated: $t({defaultMessage: "Smileys & Emotion"}),+ },+ {+ name: "People & Body",+ icon: "fa-thumbs-o-up",+ translated: $t({defaultMessage: "People & Body"}),+ },+ {+ name: "Animals & Nature",+ icon: "fa-leaf",+ translated: $t({defaultMessage: "Animals & Nature"}),+ },+ {name: "Food & Drink", icon: "fa-cutlery", translated: $t({defaultMessage: "Food & Drink"})},+ {name: "Activities", icon: "fa-soccer-ball-o", translated: $t({defaultMessage: "Activities"})},+ {name: "Travel & Places", icon: "fa-car", translated: $t({defaultMessage: "Travel & Places"})},+ {name: "Objects", icon: "fa-lightbulb-o", translated: $t({defaultMessage: "Objects"})},+ {name: "Symbols", icon: "fa-hashtag", translated: $t({defaultMessage: "Symbols"})},+ {name: "Flags", icon: "fa-flag", translated: $t({defaultMessage: "Flags"})},+ {name: "Custom", icon: "fa-cog", translated: $t({defaultMessage: "Custom"})},];function get_total_sections(): number {@@ -173,6 +186,7 @@ export function rebuild_catalog(): void {icon: category.icon,// The ! type assertion is correct because of the filter above.emojis: catalog.get(category.name)!,+ translated: category.translated,}));const emojis_by_category = complete_emoji_catalog.flatMap((category) => {if (category.name === "Popular") {diff --git a/web/templates/popovers/emoji/emoji_popover_emoji_map.hbs b/web/templates/popovers/emoji/emoji_popover_emoji_map.hbsindex 87dc5f20f12..689f22b4bc3 100644--- a/web/templates/popovers/emoji/emoji_popover_emoji_map.hbs+++ b/web/templates/popovers/emoji/emoji_popover_emoji_map.hbs@@ -1,5 +1,5 @@{{#each emoji_categories }}- <div class="emoji-popover-subheading" data-section="{{name}}">{{name}}</div>+ <div class="emoji-popover-subheading" data-section="{{name}}">{{translated}}</div><div class="emoji-collection" data-section="{{name}}">{{#each this.emojis }}{{> emoji_popover_emoji type="emoji_picker_emoji" section=@../index index=@index message_id=../../message_id is_status_emoji_popover=../../is_status_emoji_popover emoji_dict=this}}