Class: GyomuRuby::OrdinarySystemDevelopment::Translation

Inherits:
Object
  • Object
show all
Defined in:
lib/gyomu_ruby/ordinary_system_development/translated_from.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locale = I18n.locale) ⇒ Translation

Returns a new instance of Translation.



8
9
10
# File 'lib/gyomu_ruby/ordinary_system_development/translated_from.rb', line 8

def initialize(locale = I18n.locale)
  @locale = locale
end

Class Method Details

.source(word, scope) ⇒ Object



4
5
6
# File 'lib/gyomu_ruby/ordinary_system_development/translated_from.rb', line 4

def self.source(word, scope)
  new('ja').source(word, scope)
end

Instance Method Details

#source(word, scope) ⇒ Object



12
13
14
# File 'lib/gyomu_ruby/ordinary_system_development/translated_from.rb', line 12

def source(word, scope)
  I18n.t!(scope, locale: @locale).key(word.to_s).try(:to_s)
end