Skip to content

Commit

Permalink
Only strip country code when language not listed in SUPPORTED_LOCALES (
Browse files Browse the repository at this point in the history
  • Loading branch information
gunchleoc committed Sep 28, 2023
1 parent 57f592f commit ce79cac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/helpers/languages_helper.rb
Expand Up @@ -254,6 +254,7 @@ def standard_locale_name(locale)

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

Expand Down

0 comments on commit ce79cac

Please sign in to comment.