Module: IceCube::I18n

Defined in:
lib/ice_cube/i18n.rb

Constant Summary collapse

LOCALES_PATH =
File.expand_path(File.join('..', '..', '..', 'config', 'locales'), __FILE__)

Class Method Summary collapse

Class Method Details

.backendObject



16
17
18
# File 'lib/ice_cube/i18n.rb', line 16

def self.backend
  @backend ||= detect_backend!
end

.detect_backend!Object



20
21
22
23
24
25
# File 'lib/ice_cube/i18n.rb', line 20

def self.detect_backend!
  ::I18n.load_path += Dir[File.join(LOCALES_PATH, '*.yml')]
  ::I18n
rescue NameError
  NullI18n
end

.l(*args) ⇒ Object



12
13
14
# File 'lib/ice_cube/i18n.rb', line 12

def self.l(*args)
  backend.l(*args)
end

.t(*args) ⇒ Object



8
9
10
# File 'lib/ice_cube/i18n.rb', line 8

def self.t(*args)
  backend.t(*args)
end