Merge branch 'target-languages' into 'develop'
Include unspecified variants in target languages list for DeepL See merge request soapbox-pub/rebased!227
This commit is contained in:
commit
8a1898591e
1 changed files with 9 additions and 0 deletions
|
@ -80,6 +80,15 @@ def supported_languages(type) when type in [:source, :target] do
|
||||||
languages =
|
languages =
|
||||||
Jason.decode!(res.body)
|
Jason.decode!(res.body)
|
||||||
|> Enum.map(fn %{"language" => language} -> language |> String.downcase() end)
|
|> 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}
|
{:ok, languages}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue