Module: LittleWeasel::Modules::Locale

Includes:
Language, Region
Included in:
DictionaryKey
Defined in:
lib/LittleWeasel/modules/locale.rb

Overview

This module provides methods to handle conversion of parts of a locale to their string counter parts.

Instance Method Summary collapse

Methods included from Region

#normalize_region, normalize_region, #normalize_region!, #region?

Methods included from Language

#language?, #normalize_language, normalize_language, #normalize_language!

Instance Method Details

#localeObject



14
15
16
17
18
19
20
# File 'lib/LittleWeasel/modules/locale.rb', line 14

def locale
  language = normalize_language self.language
  return language.to_s unless region?

  region = normalize_region self.region
  "#{language}-#{region}"
end