Only strip country code when language not listed in SUPPORTED_LOCALES (#27099)

th-downstream
gunchleoc 12 months ago committed by GitHub
parent 57f592fed5
commit ce79caca4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -254,6 +254,7 @@ module LanguagesHelper
def valid_locale_or_nil(str) def valid_locale_or_nil(str)
return if str.blank? 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 code, = str.to_s.split(/[_-]/) # Strip out the region from e.g. en_US or ja-JP

Loading…
Cancel
Save