Class: Codebreaker::Localization

Inherits:
Object
  • Object
show all
Defined in:
lib/codebreaker/localization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_type, external_path = false, lang = :en) ⇒ Localization

Returns a new instance of Localization.



7
8
9
10
11
12
13
# File 'lib/codebreaker/localization.rb', line 7

def initialize(app_type, external_path = false, lang = :en)
  @lang = lang
  apply_external_path(external_path)
  select_application(app_type)
  candidates_to_load
  merge_localizations
end

Instance Attribute Details

#langObject

Returns the value of attribute lang.



5
6
7
# File 'lib/codebreaker/localization.rb', line 5

def lang
  @lang
end

Instance Method Details

#allObject



20
21
22
# File 'lib/codebreaker/localization.rb', line 20

def all
  localizations.keys
end

#localizationObject



15
16
17
18
# File 'lib/codebreaker/localization.rb', line 15

def localization
  return localizations[:en] unless localizations[lang]
  localizations[lang]
end