Compare commits
No commits in common. "30367cc9571e84022561b1d9bc4f29207a574511" and "04a0f875a3bf6a431878513afa678939aead5ba7" have entirely different histories.
30367cc957
...
04a0f875a3
6 changed files with 8 additions and 14 deletions
|
@ -8,12 +8,6 @@ All notable changes to this project will be documented in this file.
|
||||||
**The 4.0.x branch will not receive any update after 2023-10-31.**
|
**The 4.0.x branch will not receive any update after 2023-10-31.**
|
||||||
This means that no security fix will be made available for this branch after this date, and you will need to update to a more recent version (such as the 4.1.x branch) to receive security fixes.
|
This means that no security fix will be made available for this branch after this date, and you will need to update to a more recent version (such as the 4.1.x branch) to receive security fixes.
|
||||||
|
|
||||||
## [4.0.11] - 2023-09-20
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix post translation erroring out ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/26990))
|
|
||||||
|
|
||||||
## [4.0.10] - 2023-09-19
|
## [4.0.10] - 2023-09-19
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -46,7 +46,7 @@ class TranslationService::DeepL < TranslationService
|
||||||
|
|
||||||
raise UnexpectedResponseError unless json.is_a?(Hash)
|
raise UnexpectedResponseError unless json.is_a?(Hash)
|
||||||
|
|
||||||
Translation.new(text: Sanitize.fragment(json.dig('translations', 0, 'text'), Sanitize::Config::MASTODON_STRICT), detected_source_language: json.dig('translations', 0, 'detected_source_language')&.downcase, provider: 'DeepL.com')
|
Translation.new(text: json.dig('translations', 0, 'text'), detected_source_language: json.dig('translations', 0, 'detected_source_language')&.downcase, provider: 'DeepL.com')
|
||||||
rescue Oj::ParseError
|
rescue Oj::ParseError
|
||||||
raise UnexpectedResponseError
|
raise UnexpectedResponseError
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,7 +37,7 @@ class TranslationService::LibreTranslate < TranslationService
|
||||||
|
|
||||||
raise UnexpectedResponseError unless json.is_a?(Hash)
|
raise UnexpectedResponseError unless json.is_a?(Hash)
|
||||||
|
|
||||||
Translation.new(text: Sanitize.fragment(json['translatedText'], Sanitize::Config::MASTODON_STRICT), detected_source_language: source_language, provider: 'LibreTranslate')
|
Translation.new(text: json['translatedText'], detected_source_language: source_language, provider: 'LibreTranslate')
|
||||||
rescue Oj::ParseError
|
rescue Oj::ParseError
|
||||||
raise UnexpectedResponseError
|
raise UnexpectedResponseError
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,8 +12,8 @@ class TranslateStatusService < BaseService
|
||||||
@content = status_content_format(@status)
|
@content = status_content_format(@status)
|
||||||
@target_language = target_language
|
@target_language = target_language
|
||||||
|
|
||||||
Rails.cache.fetch("translations:v2/#{@status.language}/#{@target_language}/#{content_hash}", expires_in: CACHE_TTL) do
|
Rails.cache.fetch("translations/#{@status.language}/#{@target_language}/#{content_hash}", expires_in: CACHE_TTL) do
|
||||||
translation_backend.translate(@content, @status.language, @target_language)
|
Sanitize.fragment(translation_backend.translate(@content, @status.language, @target_language), Sanitize::Config::MASTODON_STRICT)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ services:
|
||||||
|
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
image: ghcr.io/mastodon/mastodon:v4.0.11
|
image: ghcr.io/mastodon/mastodon:v4.0.10
|
||||||
restart: always
|
restart: always
|
||||||
env_file: .env.production
|
env_file: .env.production
|
||||||
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
|
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
|
||||||
|
@ -77,7 +77,7 @@ services:
|
||||||
|
|
||||||
streaming:
|
streaming:
|
||||||
build: .
|
build: .
|
||||||
image: ghcr.io/mastodon/mastodon:v4.0.11
|
image: ghcr.io/mastodon/mastodon:v4.0.10
|
||||||
restart: always
|
restart: always
|
||||||
env_file: .env.production
|
env_file: .env.production
|
||||||
command: node ./streaming
|
command: node ./streaming
|
||||||
|
@ -95,7 +95,7 @@ services:
|
||||||
|
|
||||||
sidekiq:
|
sidekiq:
|
||||||
build: .
|
build: .
|
||||||
image: ghcr.io/mastodon/mastodon:v4.0.11
|
image: ghcr.io/mastodon/mastodon:v4.0.10
|
||||||
restart: always
|
restart: always
|
||||||
env_file: .env.production
|
env_file: .env.production
|
||||||
command: bundle exec sidekiq
|
command: bundle exec sidekiq
|
||||||
|
|
|
@ -13,7 +13,7 @@ module Mastodon
|
||||||
end
|
end
|
||||||
|
|
||||||
def patch
|
def patch
|
||||||
11
|
10
|
||||||
end
|
end
|
||||||
|
|
||||||
def flags
|
def flags
|
||||||
|
|
Loading…
Reference in a new issue