Method: CSL::Locale#set
- Defined in:
- lib/csl/locale.rb
#set(locale) ⇒ self
Sets language and region according to the passed-in locale string. If the region part is not defined by the string, this method will set the region to the default region for the given language.
183 184 185 186 |
# File 'lib/csl/locale.rb', line 183 def set(locale) @language, @region = Locale.normalize(locale).split(/-/).map(&:to_sym) self end |