lib/locale/driver/jruby.rb in locale-2.0.1 vs lib/locale/driver/jruby.rb in locale-2.0.2
- old
+ new
@@ -9,11 +9,11 @@
Original: Ruby-GetText-Package-1.92.0.
$Id: jruby.rb 27 2008-12-03 15:06:50Z mutoh $
=end
-require 'locale/driver/env'
+require File.join(File.dirname(__FILE__), 'env')
require 'java'
module Locale
module Driver
# Locale::Driver::JRuby module for JRuby
@@ -31,12 +31,17 @@
module_function
def locales #:nodoc:
locales = ::Locale::Driver::Env.locales
unless locales
locale = java.util.Locale.getDefault
+ variant = Locale.getVariant
+ variants = []
+ if valiant != nil and variant.size > 0
+ valiants = [valiant]
+ end
locales = TagList.new([Locale::Tag::Common.new(locale.getLanguage, nil,
locale.getCountry,
- [locale.getVariant])])
+ variants)])
end
locales
end
def charset