Sha256: c9e23d16bf718da3ca3e606912a876a4b52198970758918f168c5f8881847bb3

Contents?: true

Size: 572 Bytes

Versions: 3

Compression:

Stored size: 572 Bytes

Contents

class java::util::Locale
  def self.current_locale
    self.getDefault
  end

  def self.current_locale=(l)
    self.setDefault(l.to_locale)
  end
  
  def to_locale
    self
  end
  
  def human_name
    l = Locale.current_locale
    display_country = country.blank? ? "" : " (#{getDisplayCountry(l)})"
    display_variant = variant.blank? ? "" : " - #{getDisplayVariant(l)}"
    "#{getDisplayLanguage(l)}#{display_country}#{display_variant}"
  end
  
  def inspect
    "Locale[#{human_name}]"
  end

  def to_str
    to_s
  end
  
  def to_sym
    to_s.to_sym
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jactive_support-1.0.2 lib/jactive_support/java_ext/locale.rb
jactive_support-1.0.1-universal-java-1.6 lib/jactive_support/java_ext/locale.rb
jactive_support-1.0.0-universal-java-1.6 lib/jactive_support/java_ext/locale.rb