Class: GAI18n::Translation
- Inherits:
-
Object
- Object
- GAI18n::Translation
- Defined in:
- lib/gai18n/translation.rb
Instance Method Summary collapse
Instance Method Details
#submit(key:, translation:, language:) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/gai18n/translation.rb', line 3 def submit(key:, translation:, language:) arr = key.split('.') + [translation] result = arr.reverse.inject({}) do |hash, k| if k == translation k else { k => hash } end end result end |