Sha256: 17fa2ee213b6fc02228ff7bd9a370c99a3590b65eb05b917631b733b49d10e73

Contents?: true

Size: 614 Bytes

Versions: 16

Compression:

Stored size: 614 Bytes

Contents

require 'rubygems'
require 'locale'

puts "Get the current locale."

p Locale.current  #=> Returns a language in a TagList.
p Locale.charset
p Locale.current.language
p Locale.current[0].language  #=> same result.

ENV["LANGUAGE"] = "ja_JP.eucJP:fr_FR"
puts "Set LANGUAGE." + ENV["LANGUAGE"]

# Clear locale because the values are cached.
Locale.clear

p Locale.current   #=> Return 2 languages in a TagList.
p Locale.current[0].language
p Locale.current[1].language
p Locale.current.language   #=> Same with Locale.current[0].language.
p Locale.charset

p "Locale.candidates"
p Locale.current
p Locale.candidates

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
locale-2.1.4 samples/sample_1.rb
locale-2.1.3 samples/sample_1.rb
locale-2.1.2 samples/sample_1.rb
locale-2.1.1 samples/sample_1.rb
locale-2.1.0 samples/sample_1.rb
locale-2.0.9 samples/sample_1.rb
locale-2.0.8 samples/sample_1.rb
locale-2.0.7 samples/sample_1.rb
locale-2.0.6 samples/sample_1.rb
locale-2.0.5 samples/sample_1.rb
locale-0.9.0 samples/sample_1.rb
locale-2.0.0 samples/sample_1.rb
locale-2.0.3 samples/sample_1.rb
locale-2.0.2 samples/sample_1.rb
locale-2.0.1 samples/sample_1.rb
locale-2.0.4 samples/sample_1.rb