mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-01 14:54:42 +08:00
This is a follow up to https://github.com/discourse/discourse/pull/34900. When a user manually updates translation via the translation composer, also send the new translated cooked for post processing. I moved the Processor to core, given PostLocalizations are core feature. <img width="551" height="385" alt="Screenshot 2025-10-08 at 6 12 26 PM" src="https://github.com/user-attachments/assets/1cce7ce3-5487-4e75-90fd-440792b9a899" />
15 lines
415 B
Ruby
15 lines
415 B
Ruby
# frozen_string_literal: true
|
|
|
|
class PostLocalizationDestroyer
|
|
def self.destroy(post_id:, locale:, acting_user:)
|
|
Guardian.new(acting_user).ensure_can_localize_content!
|
|
|
|
localization = PostLocalization.find_by(post_id: post_id, locale: locale)
|
|
raise Discourse::NotFound unless localization
|
|
post = localization.post
|
|
|
|
localization.destroy!
|
|
|
|
post.publish_change_to_clients! :revised
|
|
end
|
|
end
|