mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
Only strip country code when language not listed in SUPPORTED_LOCALES (#27099)
This commit is contained in:
parent
57f592fed5
commit
ce79caca4e
@ -254,6 +254,7 @@ module LanguagesHelper
|
||||
|
||||
def valid_locale_or_nil(str)
|
||||
return if str.blank?
|
||||
return str if valid_locale?(str)
|
||||
|
||||
code, = str.to_s.split(/[_-]/) # Strip out the region from e.g. en_US or ja-JP
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user