mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-18 07:48:19 +00:00
Lint
This commit is contained in:
parent
07bd35227a
commit
fcfb5a4967
|
@ -58,7 +58,8 @@ defmodule Pleroma.Web.Gettext do
|
|||
def ensure_fallbacks(locales) do
|
||||
locales
|
||||
|> Enum.flat_map(fn locale ->
|
||||
others = other_supported_variants_of_locale(locale)
|
||||
others =
|
||||
other_supported_variants_of_locale(locale)
|
||||
|> Enum.filter(fn l -> not Enum.member?(locales, l) end)
|
||||
|
||||
[locale] ++ others
|
||||
|
@ -80,7 +81,7 @@ defmodule Pleroma.Web.Gettext do
|
|||
end
|
||||
end
|
||||
|
||||
def get_locales() do
|
||||
def get_locales do
|
||||
Process.get({Pleroma.Web.Gettext, :locales}, [])
|
||||
end
|
||||
|
||||
|
|
|
@ -87,7 +87,9 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do
|
|||
|> SetLocalePlug.call([])
|
||||
|
||||
assert "zh_Hans" == Gettext.get_locale()
|
||||
assert %{locale: "zh_Hans", locales: ["zh_Hans", "uk", "zh_Hant", "ru", "fr", "en"]} = conn.assigns
|
||||
|
||||
assert %{locale: "zh_Hans", locales: ["zh_Hans", "uk", "zh_Hant", "ru", "fr", "en"]} =
|
||||
conn.assigns
|
||||
end
|
||||
|
||||
test "fallback to some variant of the language if the unqualified language is not supported" do
|
||||
|
|
Loading…
Reference in a new issue