Fix post translation erroring out (v4.1.x) (#26990)

This commit is contained in:
Claire
2023-09-20 15:59:57 +02:00
committed by GitHub
parent af0ee12908
commit 5d93c5f019
3 changed files with 4 additions and 4 deletions

View File

@@ -12,8 +12,8 @@ class TranslateStatusService < BaseService
@content = status_content_format(@status)
@target_language = target_language
Rails.cache.fetch("translations/#{@status.language}/#{@target_language}/#{content_hash}", expires_in: CACHE_TTL) do
Sanitize.fragment(translation_backend.translate(@content, @status.language, @target_language), Sanitize::Config::MASTODON_STRICT)
Rails.cache.fetch("translations:v2/#{@status.language}/#{@target_language}/#{content_hash}", expires_in: CACHE_TTL) do
translation_backend.translate(@content, @status.language, @target_language)
end
end