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/
This commit is contained in:
锦心 2024-07-22 18:42:36 +08:00 committed by GitHub
parent 0eeebeb6b1
commit dfd4da9656
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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