Skip to content

Commit

Permalink
FIX: allows to translate yesterday (#25446)
Browse files Browse the repository at this point in the history
The value [Yesterday] was a fixed string which couldn't be translated. Also removes nextWeek/nextDay which make no sense for dates which are always supposed to be in the past.
  • Loading branch information
jjaffeux committed Jan 27, 2024
1 parent 6d57da1 commit 68288a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Component from "@glimmer/component";
import I18n from "I18n";
import ChatChannelUnreadIndicator from "./chat-channel-unread-indicator";

export default class ChatChannelMetadata extends Component {
Expand All @@ -9,9 +10,7 @@ export default class ChatChannelMetadata extends Component {
get lastMessageFormattedDate() {
return moment(this.args.channel.lastMessage.createdAt).calendar(null, {
sameDay: "LT",
nextDay: "[Tomorrow]",
nextWeek: "dddd",
lastDay: "[Yesterday]",
lastDay: `[${I18n.t("chat.dates.yesterday")}]`,
lastWeek: "dddd",
sameElse: "l",
});
Expand Down
1 change: 1 addition & 0 deletions plugins/chat/config/locales/client.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ en:
back_to_forum: "Forum"
deleted_chat_username: deleted
dates:
yesterday: "Yesterday"
time_tiny: "h:mm"
all_loaded: "Showing all messages"
already_enabled: "Chat is already enabled on this topic. Please refresh."
Expand Down

0 comments on commit 68288a3

Please sign in to comment.