2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-03 23:54:20 +08:00
discourse/app/serializers/user_post_topic_bookmark_base_serializer.rb
Natalie Tay c61a6f83e7
FEATURE: Localize topic titles in notifications and bookmarks (#34059)
Localizes topic titles in these areas
- user notification
- bookmarks

This commit also updates the user notification bookmark list to use fancy
title instead of title, similar to the other user notification tabs.
2025-08-05 12:12:22 +08:00

57 lines
949 B
Ruby

# frozen_string_literal: true
require_relative "post_item_excerpt"
class UserPostTopicBookmarkBaseSerializer < UserBookmarkBaseSerializer
include TopicTagsMixin
include PostItemExcerpt
include LocalizedFancyTopicTitleMixin
attributes :topic_id,
:linked_post_number,
:deleted,
:hidden,
:category_id,
:closed,
:archived,
:archetype,
:highest_post_number,
:bumped_at,
:slug
def topic_id
topic.id
end
def title
topic.title
end
def category_id
topic.category_id
end
def archetype
topic.archetype
end
def archived
topic.archived
end
def closed
topic.closed
end
def highest_post_number
scope.is_whisperer? ? topic.highest_staff_post_number : topic.highest_post_number
end
def bumped_at
topic.bumped_at
end
def slug
topic.slug
end
end