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.
This commit is contained in:
Bianca Nenciu 2023-04-04 16:28:04 +03:00 committed by GitHub
parent 2386ad12f2
commit 6da2fbbf76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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`),
};
});
},

View File

@ -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"