From b128f7ffcdf3d1e815d409ac9bce86c2cf11445c Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 9 Jan 2011 07:39:16 +0000 Subject: * lib/irb/locale.rb (IRB::Locale::LOCALE_NAME_RE): some platoform has a locale without territory but with encoding. (#each_sub_locale): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/irb/locale.rb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb index b37ad08403..142b9a5951 100644 --- a/lib/irb/locale.rb +++ b/lib/irb/locale.rb @@ -13,16 +13,10 @@ module IRB @RCS_ID='-$Id$-' LOCALE_NAME_RE = %r[ - (?[[:alpha:]]{2}) - (?:_ - (?[[:alpha:]]{2,3}) - (?:\. - (?[^@]+) - )? - )? - (?:@ - (?.*) - )? + (?[[:alpha:]]{2,3}) + (?:_ (?[[:alpha:]]{2,3}) )? + (?:\. (?[^@]+) )? + (?:@ (?.*) )? ]x LOCALE_DIR = "/lc/" @@ -175,6 +169,10 @@ module IRB yield "#{@lang}_#{@territory}@#{@modifier}" if @modifier yield "#{@lang}_#{@territory}" end + if @encoding_name + yield "#{@lang}.#{@encoding_name}@#{@modifier}" if @modifier + yield "#{@lang}.#{@encoding_name}" + end yield "#{@lang}@#{@modifier}" if @modifier yield "#{@lang}" end -- cgit v1.2.3