Lint
authorTusooa Zhu <tusooa@kazv.moe>
Thu, 3 Mar 2022 14:40:18 +0000 (09:40 -0500)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Wed, 29 Jun 2022 19:47:10 +0000 (20:47 +0100)
lib/pleroma/web/gettext.ex
test/pleroma/web/plugs/set_locale_plug_test.exs

index cd795008d07c5c1f8d69e64e3c4634508b1af84b..89feb0bb3f0e9fcfe6199f8573d1ffb0e0a2f30a 100644 (file)
@@ -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
 
index ff04a859e95d007f2af2d9505218ae15c791ddaa..f9d34bbe48ac62beb76eabfd495150ceadac59b4 100644 (file)
@@ -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