Implement /api/v1/instance/translation_languages
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
010c23e729
commit
f954f98fb7
10 changed files with 107 additions and 1 deletions
|
|
@ -113,4 +113,13 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do
|
|||
assert get(conn, "/api/v2/instance")
|
||||
|> json_response_and_validate_schema(200)
|
||||
end
|
||||
|
||||
test "translation languages matrix", %{conn: conn} do
|
||||
clear_config([Pleroma.Language.Translation, :provider], TranslationMock)
|
||||
|
||||
assert %{"en" => ["pl"], "pl" => ["en"]} =
|
||||
conn
|
||||
|> get("/api/v1/instance/translation_languages")
|
||||
|> json_response_and_validate_schema(200)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -24,7 +24,16 @@ defmodule TranslationMock do
|
|||
|
||||
@impl Provider
|
||||
def supported_languages(_) do
|
||||
["en", "pl"]
|
||||
{:ok, ["en", "pl"]}
|
||||
end
|
||||
|
||||
@impl Provider
|
||||
def languages_matrix do
|
||||
{:ok,
|
||||
%{
|
||||
"en" => ["pl"],
|
||||
"pl" => ["en"]
|
||||
}}
|
||||
end
|
||||
|
||||
@impl Provider
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue