Files
discourse/spec/serializers/post_localization_serializer_spec.rb
Keegan George 6154fa6b45 FEATURE: Add translations to posts (#32564)
## 🔍 Overview
This update adds the ability for users to manually add translations to
specific posts. It adds a 🌐 icon on the post menu where you can click to
add translations for posts.

It also introduces a new site setting:
`content_localization_debug_allowed_groups` which is convenient when
debugging localized posts. It adds a globe icon in the post meta data
area along with a number of how many languages the post is translated
in. Hovering over the icon will show a tooltip with access to editing
and deleting the translated posts.

## 📸 Screenshots
<img width="1234" alt="Screenshot 2025-05-07 at 13 26 09"
src="https://github.com/user-attachments/assets/9d65374d-ee3e-4e8b-b171-b98db6f90f23"
/>
<img width="300" alt="Screenshot 2025-05-07 at 13 26 41"
src="https://github.com/user-attachments/assets/6ee9c5e6-16ed-4dab-97ec-9401804a4ac8"
/>
2025-05-08 10:40:36 -07:00

19 lines
494 B
Ruby

# frozen_string_literal: true
describe PostLocalizationSerializer do
fab!(:post_localization)
describe "serialized attributes" do
it "disaplays every attribute" do
serialized = described_class.new(post_localization, scope: Guardian.new, root: false)
expect(serialized).to have_attributes(
id: post_localization.id,
post_id: post_localization.post_id,
locale: post_localization.locale,
raw: post_localization.raw,
)
end
end
end