Class: Baykit::BayServer::Util::Locale
- Inherits:
-
Object
- Object
- Baykit::BayServer::Util::Locale
- Defined in:
- lib/baykit/bayserver/util/locale.rb
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(language, country) ⇒ Locale
constructor
A new instance of Locale.
Constructor Details
#initialize(language, country) ⇒ Locale
Returns a new instance of Locale.
8 9 10 11 |
# File 'lib/baykit/bayserver/util/locale.rb', line 8 def initialize(language, country) @language = language @country = country end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
6 7 8 |
# File 'lib/baykit/bayserver/util/locale.rb', line 6 def country @country end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
5 6 7 |
# File 'lib/baykit/bayserver/util/locale.rb', line 5 def language @language end |
Class Method Details
.default ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/baykit/bayserver/util/locale.rb', line 14 def self.default() lang = ENV['LANG'] if StringUtil.set?(lang) begin language = lang[0, 2] country = lang[3, 2] return Locale.new(language, country) rescue => e BayLog.error_e(e) end end return Locale.new("en", "US") end |