module I18n::MissingTranslation::Base
Public Instance Methods
message()
click to toggle source
# File lib/sdl/util/documentation.rb, line 10 def message puts old_message I18n.backend.store_translations I18n.locale, to_deep_hash({@key => 'Translate'}) old_message end
Also aliased as: old_message
to_deep_hash(hash)
click to toggle source
Taken from: www.ruby-doc.org/gems/docs/t/translate-rails3-0.2.2/Translate/Keys.html
# File lib/sdl/util/documentation.rb, line 19 def to_deep_hash(hash) hash.inject({}) do |deep_hash, (key, value)| keys = key.to_s.split('.').reverse leaf_key = keys.shift key_hash = keys.inject({leaf_key.to_sym => value}) { |hash, key| {key.to_sym => hash} } deep_hash.deep_merge!(key_hash) deep_hash end end