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 authored and TheEssem committed Sep 28, 2023
1 parent 8d776b9 commit c85a1b8
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 c85a1b8

Please sign in to comment.