From dfd4da9656db46441f6daab062097472d8817daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=A6=E5=BF=83?= <41134017+Lhcfl@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:42:36 +0800 Subject: [PATCH] UX: Use localized time format in embedded comments (#28014) Previously, the time format for embedded comments was hardcoded. This commit changes it to the time format defined in I18n. Related meta topic: https://meta.discourse.org/t/embed-dates-are-not-localized/27997/ --- app/helpers/embed_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/embed_helper.rb b/app/helpers/embed_helper.rb index 5e133167fbf..42db197c115 100644 --- a/app/helpers/embed_helper.rb +++ b/app/helpers/embed_helper.rb @@ -8,9 +8,9 @@ module EmbedHelper distance_of_time_in_words(dt, current) else if dt.year == current.year - dt.strftime("%e %b") + dt.strftime I18n.t("datetime_formats.formats.short_no_year") else - dt.strftime("%b '%y") + dt.strftime I18n.t("datetime_formats.formats.no_day") end end end