mirror of
https://github.com/ClaperCo/Claper.git
synced 2025-12-29 00:25:02 +01:00
fix locales with more than 2 parts
This commit is contained in:
@@ -117,10 +117,9 @@ defmodule ClaperWeb.Plugs.Locale do
|
||||
end
|
||||
|
||||
defp fallback_tags(tag, tags) do
|
||||
case String.split(tag, "-") do
|
||||
case String.split(tag, "-", parts: 2) do
|
||||
[language, _country_variant] ->
|
||||
if Enum.member?(tags, language), do: [tag], else: [tag, language]
|
||||
|
||||
[_language] ->
|
||||
[tag]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user