From e7ce24966b861bfcf21e95e890b95878b3ac0d7a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 23 Mar 2022 12:33:04 +0100 Subject: [PATCH] Fix loading list of languages after ex_cldr update Signed-off-by: Thomas Citharel --- lib/graphql/resolvers/admin.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/graphql/resolvers/admin.ex b/lib/graphql/resolvers/admin.ex index 369eb26b..cb738a14 100644 --- a/lib/graphql/resolvers/admin.ex +++ b/lib/graphql/resolvers/admin.ex @@ -178,7 +178,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do def get_list_of_languages(_parent, %{codes: codes}, _resolution) when is_list(codes) do locale = Mobilizon.Cldr.locale_or_default(Gettext.get_locale()) - case Language.known_languages(locale) do + case Language.known_languages(String.to_existing_atom(locale)) do data when is_map(data) -> data |> Enum.map(fn {code, elem} -> %{code: code, name: elem.standard} end) @@ -193,7 +193,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do def get_list_of_languages(_parent, _args, _resolution) do locale = Gettext.get_locale() - case Language.known_languages(locale) do + case Language.known_languages(String.to_existing_atom(locale)) do data when is_map(data) -> data = Enum.map(data, fn {code, elem} -> %{code: code, name: elem.standard} end) {:ok, data}