DeepL: fix endpoint

This commit is contained in:
Alex Gleason 2022-11-06 08:24:54 -06:00
parent a01e88a9d3
commit 5e6bb2aed0
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -16,7 +16,7 @@ def configured? do
@impl Provider @impl Provider
def translate(content, source_language, target_language) do def translate(content, source_language, target_language) do
endpoint = get_base_url() endpoint = get_endpoint()
case Pleroma.HTTP.post( case Pleroma.HTTP.post(
endpoint <> endpoint <>
@ -58,6 +58,10 @@ def translate(content, source_language, target_language) do
end end
end end
defp get_endpoint do
URI.merge(get_base_url(), "/v2/translate")
end
defp get_base_url do defp get_base_url do
Pleroma.Config.get([__MODULE__, :base_url]) Pleroma.Config.get([__MODULE__, :base_url])
end end