Skip to content

Commit

Permalink
Allow 3-character locale names as per ISO-639
Browse files Browse the repository at this point in the history
  • Loading branch information
psy-q committed May 8, 2012
1 parent 7844ad1 commit 1f2ee0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fast_gettext/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def weighted_locales(locales)

#de-de -> de_DE
def format_locale(locale)
locale.sub(/^([a-zA-Z]{2})[-_]([a-zA-Z]{2})$/){$1.downcase+'_'+$2.upcase}
locale.sub(/^([a-zA-Z]{2,3})[-_]([a-zA-Z]{2,3})$/){$1.downcase+'_'+$2.upcase}
end

def update_current_cache
Expand Down

0 comments on commit 1f2ee0c

Please sign in to comment.