From a742bd6c22698c9462677f2429f7db184dca86a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 20 Aug 2024 15:03:39 +0200 Subject: [PATCH] Fix translation param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- lib/pleroma/web/api_spec/operations/status_operation.ex | 2 +- lib/pleroma/web/mastodon_api/controllers/status_controller.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/api_spec/operations/status_operation.ex b/lib/pleroma/web/api_spec/operations/status_operation.ex index 5df7348f29..ba85ec62e8 100644 --- a/lib/pleroma/web/api_spec/operations/status_operation.ex +++ b/lib/pleroma/web/api_spec/operations/status_operation.ex @@ -442,7 +442,7 @@ def translate_operation do %Schema{ type: :object, properties: %{ - target_language: %Schema{ + lang: %Schema{ type: :string, nullable: true, description: "Translation target language." diff --git a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex index 763e18268d..678a994e52 100644 --- a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex @@ -574,7 +574,7 @@ def translate( Object.local?(object) || Pleroma.Config.get([Pleroma.Language.Translation, :allow_remote])}, {:language, language} when is_binary(language) <- - {:language, Map.get(params, :target_language) || user.language}, + {:language, Map.get(params, :lang) || user.language}, {:ok, result} <- Translation.translate( object.data["content"],