mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-04-14 06:54:08 +00:00
Include unspecified variants in target languages list for DeepL
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
7fca35f4fd
commit
010c23e729
1 changed files with 9 additions and 0 deletions
|
@ -80,6 +80,15 @@ defmodule Pleroma.Language.Translation.Deepl do
|
|||
languages =
|
||||
Jason.decode!(res.body)
|
||||
|> Enum.map(fn %{"language" => language} -> language |> String.downcase() end)
|
||||
|> Enum.map(fn language ->
|
||||
if String.contains?(language, "-") do
|
||||
[language, language |> String.split("-") |> Enum.at(0)]
|
||||
else
|
||||
language
|
||||
end
|
||||
end)
|
||||
|> List.flatten()
|
||||
|> Enum.uniq()
|
||||
|
||||
{:ok, languages}
|
||||
|
||||
|
|
Loading…
Reference in a new issue