Class: Sijka::Translator

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

Instance Method Summary collapse

Constructor Details

#initializeTranslator

Returns a new instance of Translator.



5
6
7
8
# File 'lib/sijka/translator.rb', line 5

def initialize
  I18n.load_path = Dir.glob("#{$LOAD_PATH.first}/../locales/*.yml")
  I18n.enforce_available_locales = false
end

Instance Method Details

#smoken_with_locale(subject) ⇒ Object



10
11
12
# File 'lib/sijka/translator.rb', line 10

def smoken_with_locale(subject)
  I18n.t subject, locale: I18n.locale, default: I18n.t('sijka', locale: :en)
end