Class: ManabuDesktop::Tools

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

Constant Summary collapse

@@_initialized =
false
@@_emojidex =
nil

Class Method Summary collapse

Class Method Details

.emojidexObject



27
28
29
30
31
# File 'lib/tools.rb', line 27

def self.emojidex()
  return @@_emojidex if @@_emojidex
  @@_emojidex = Emojidex::Data::UTF.new
  @@_emojidex
end

.initObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/tools.rb', line 10

def self.init()
  return if @@_initialized

  I18n.load_path = Dir["#{__dir__}/../locales/*.yml"]

  # TODO there must be a better way to determine language
  @lang = (ENV['LANG'][0..1]).to_sym
  if I18n.available_locales.include? @lang
    I18n.locale = @lang
  else
    I18n.locale = :en
    @lang = :en
  end

  @@_initialized = true
end