about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-05-11 01:09:21 +0200
committerGitHub <noreply@github.com>2020-05-11 01:09:21 +0200
commit4bcef12bad8f554f3b0fc2fc34b7d4ca4cc567db (patch)
tree2bf5fb2eb81f92549ae2ca5a925a559260463f3c /app
parent4b2d9b8a558190f8ccc51cfe67f5e151f2c3342b (diff)
Fix sr locale being selected over sr-Latn (#13693)
* Fix sr locale being selected over sr-Latn

* Update tests
Diffstat (limited to 'app')
-rw-r--r--app/controllers/concerns/localized.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/app/controllers/concerns/localized.rb b/app/controllers/concerns/localized.rb
index b43859d9d..d1384ed56 100644
--- a/app/controllers/concerns/localized.rb
+++ b/app/controllers/concerns/localized.rb
@@ -28,18 +28,6 @@ module Localized
   end
 
   def request_locale
-    preferred_locale || compatible_locale
-  end
-
-  def preferred_locale
-    http_accept_language.preferred_language_from(available_locales)
-  end
-
-  def compatible_locale
-    http_accept_language.compatible_language_from(available_locales)
-  end
-
-  def available_locales
-    I18n.available_locales.reverse
+    http_accept_language.language_region_compatible_from(I18n.available_locales)
   end
 end