[前][次][番号順一覧][スレッド一覧]

ruby-changes:18475

From: yugui <ko1@a...>
Date: Sun, 9 Jan 2011 16:39:25 +0900 (JST)
Subject: [ruby-changes:18475] Ruby:r30498 (trunk): * lib/irb/locale.rb (IRB::Locale::LOCALE_NAME_RE):

yugui	2011-01-09 16:39:16 +0900 (Sun, 09 Jan 2011)

  New Revision: 30498

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30498

  Log:
    * lib/irb/locale.rb (IRB::Locale::LOCALE_NAME_RE):
      some platoform has a locale without territory but with
      encoding.
      (#each_sub_locale): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/lib/irb/locale.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30497)
+++ ChangeLog	(revision 30498)
@@ -1,3 +1,10 @@
+Sun Jan  9 16:31:34 2011  Yuki Sonoda (Yugui)  <yugui@y...>
+
+	* lib/irb/locale.rb (IRB::Locale::LOCALE_NAME_RE): 
+	  some platoform has a locale without territory but with 
+	  encoding.
+	  (#each_sub_locale): ditto.
+
 Sun Jan  9 14:47:50 2011  TAKAO Kouji  <kouji@t...>
 
 	* ext/readline/readline.c: apply a patch from Nobuyoshi Nakada.
Index: lib/irb/locale.rb
===================================================================
--- lib/irb/locale.rb	(revision 30497)
+++ lib/irb/locale.rb	(revision 30498)
@@ -13,16 +13,10 @@
     @RCS_ID='-$Id$-'
 
     LOCALE_NAME_RE = %r[
-      (?<language>[[:alpha:]]{2})
-      (?:_
-       (?<territory>[[:alpha:]]{2,3})
-       (?:\.
-	(?<codeset>[^@]+)
-       )?
-      )?
-      (?:@
-       (?<modifier>.*)
-      )?
+      (?<language>[[:alpha:]]{2,3})
+      (?:_  (?<territory>[[:alpha:]]{2,3}) )?
+      (?:\. (?<codeset>[^@]+) )?
+      (?:@  (?<modifier>.*) )?
     ]x
     LOCALE_DIR = "/lc/"
 
@@ -175,6 +169,10 @@
 	  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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]