From 6da2fbbf768869b5560a533feef77a8f23daf9eb Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Tue, 4 Apr 2023 16:28:04 +0300 Subject: [PATCH] FIX: Use correct translation key (#20958) The translation key is built using the name of the reviewable as it was defined in Ruby. The chat plugin uses the `Chat` namespace and defines `Chat::ReviewableMessage`. This was then transformed to `chat::reviewable_message`, but it should be `chat_reviewable_message` to resemble the other translation keys. --- .../javascripts/discourse/app/controllers/review-index.js | 4 +++- plugins/chat/config/locales/client.en.yml | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/review-index.js b/app/assets/javascripts/discourse/app/controllers/review-index.js index e301a3cfeeb..acd369cd2fa 100644 --- a/app/assets/javascripts/discourse/app/controllers/review-index.js +++ b/app/assets/javascripts/discourse/app/controllers/review-index.js @@ -42,9 +42,11 @@ export default Controller.extend({ @discourseComputed("reviewableTypes") allTypes() { return (this.reviewableTypes || []).map((type) => { + const translationKey = underscore(type).replace(/[^\w]+/g, "_"); + return { id: type, - name: I18n.t(`review.types.${underscore(type)}.title`), + name: I18n.t(`review.types.${translationKey}.title`), }; }); }, diff --git a/plugins/chat/config/locales/client.en.yml b/plugins/chat/config/locales/client.en.yml index 657353d8405..dc8bae74cb2 100644 --- a/plugins/chat/config/locales/client.en.yml +++ b/plugins/chat/config/locales/client.en.yml @@ -585,9 +585,8 @@ en: transcript: view: "View previous messages transcript" types: - reviewable_chat_message: + chat_reviewable_message: title: "Flagged Chat Message" - flagged_by: "Flagged By" keyboard_shortcuts_help: chat: title: "Chat"