class ManabuDesktop::Tools

Public Class Methods

emojidex() click to toggle source
# File lib/tools.rb, line 27
def self.emojidex()
  return @@_emojidex if @@_emojidex
  @@_emojidex = Emojidex::Data::UTF.new
  @@_emojidex
end
init() click to toggle source
# 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