Add dropdown for language of Article
And a configuration with the available Deepl source and target languages.
This commit is contained in:
@ -10,6 +10,69 @@ import Config
|
|||||||
config :outlook,
|
config :outlook,
|
||||||
ecto_repos: [Outlook.Repo]
|
ecto_repos: [Outlook.Repo]
|
||||||
|
|
||||||
|
config :outlook, :deepl,
|
||||||
|
source_langs: [
|
||||||
|
{"English", "EN"},
|
||||||
|
{"Russian", "RU"},
|
||||||
|
{"German", "DE"},
|
||||||
|
{"Spanish", "ES"},
|
||||||
|
{"Bulgarian", "BG"},
|
||||||
|
{"Czech", "CS"},
|
||||||
|
{"Danish", "DA"},
|
||||||
|
{"Greek", "EL"},
|
||||||
|
{"Estonian", "ET"},
|
||||||
|
{"Finnish", "FI"},
|
||||||
|
{"French", "FR"},
|
||||||
|
{"Hungarian", "HU"},
|
||||||
|
{"Indonesian", "ID"},
|
||||||
|
{"Italian", "IT"},
|
||||||
|
{"Japanese", "JA"},
|
||||||
|
{"Lithuanian", "LT"},
|
||||||
|
{"Latvian", "LV"},
|
||||||
|
{"Dutch", "NL"},
|
||||||
|
{"Polish", "PL"},
|
||||||
|
{"Portuguese", "PT"},
|
||||||
|
{"Romanian", "RO"},
|
||||||
|
{"Slovak", "SK"},
|
||||||
|
{"Slovenian", "SL"},
|
||||||
|
{"Swedish", "SV"},
|
||||||
|
{"Turkish", "TR"},
|
||||||
|
{"Ukrainian", "UK"},
|
||||||
|
{"Chinese", "ZH"}
|
||||||
|
],
|
||||||
|
target_langs: [
|
||||||
|
{"German", "DE"},
|
||||||
|
{"English British", "EN-GB"},
|
||||||
|
{"English American", "EN-US"},
|
||||||
|
{"Bulgarian", "BG"},
|
||||||
|
{"Czech", "CS"},
|
||||||
|
{"Danish", "DA"},
|
||||||
|
{"Greek", "EL"},
|
||||||
|
{"Spanish", "ES"},
|
||||||
|
{"Estonian", "ET"},
|
||||||
|
{"Finnish", "FI"},
|
||||||
|
{"French", "FR"},
|
||||||
|
{"Hungarian", "HU"},
|
||||||
|
{"Indonesian", "ID"},
|
||||||
|
{"Italian", "IT"},
|
||||||
|
{"Japanese", "JA"},
|
||||||
|
{"Lithuanian", "LT"},
|
||||||
|
{"Latvian", "LV"},
|
||||||
|
{"Dutch", "NL"},
|
||||||
|
{"Polish", "PL"},
|
||||||
|
{"Portuguese Brazilian", "PT-BR"},
|
||||||
|
{"Portuguese International", "PT-PT"},
|
||||||
|
{"Romanian", "RO"},
|
||||||
|
{"Russian", "RU"},
|
||||||
|
{"Slovak", "SK"},
|
||||||
|
{"Slovenian", "SL"},
|
||||||
|
{"Swedish", "SV"},
|
||||||
|
{"Turkish", "TR"},
|
||||||
|
{"Ukrainian", "UK"},
|
||||||
|
{"Chinese", "ZH"}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
# Configures the endpoint
|
# Configures the endpoint
|
||||||
config :outlook, OutlookWeb.Endpoint,
|
config :outlook, OutlookWeb.Endpoint,
|
||||||
url: [host: "localhost"],
|
url: [host: "localhost"],
|
||||||
|
|||||||
@ -23,7 +23,8 @@ defmodule OutlookWeb.ArticleLive.FormComponent do
|
|||||||
<.input field={{f, :author_id}} type="hidden" />
|
<.input field={{f, :author_id}} type="hidden" />
|
||||||
<.input field={{f, :title}} type="text" label="title" />
|
<.input field={{f, :title}} type="text" label="title" />
|
||||||
<.input field={{f, :url}} type="text" label="url" />
|
<.input field={{f, :url}} type="text" label="url" />
|
||||||
<.input field={{f, :language}} type="text" label="language" />
|
<.input field={{f, :language}} type="select" label="language"
|
||||||
|
options={Application.get_env(:outlook,:deepl)[:source_langs]} />
|
||||||
<.input field={{f, :date}} type="datetime-local" label="date" />
|
<.input field={{f, :date}} type="datetime-local" label="date" />
|
||||||
<:actions>
|
<:actions>
|
||||||
<.button phx-disable-with="Saving...">Save Article</.button>
|
<.button phx-disable-with="Saving...">Save Article</.button>
|
||||||
|
|||||||
Reference in New Issue
Block a user