DeepL: fix endpoint
This commit is contained in:
parent
a01e88a9d3
commit
5e6bb2aed0
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue