h = {}
match = 'a.b.c'
tokens = match.split('.')
last = tokens[0..-2].inject(h) do |h, scope|
h[scope] ||= {}
end
last[tokens.last] = 'untranslated'
puts h.inspect
puts "----------"
def hash_by_recurse(matches, h)
return h if matches.nil? || matches.size == 0
h[matches.first] ||= {}
hash_by_recurse(matches[1..-1], h[matches.first])
h
end
h = hash_by_recurse("a.b.c".split('.'), {})
puts h.inspect
aCA9IHt9Cm1hdGNoID0gJ2EuYi5jJwp0b2tlbnMgPSBtYXRjaC5zcGxpdCgnLicpCmxhc3QgPSB0b2tlbnNbMC4uLTJdLmluamVjdChoKSBkbyB8aCwgc2NvcGV8IAogIGhbc2NvcGVdIHx8PSB7fQplbmQKbGFzdFt0b2tlbnMubGFzdF0gPSAndW50cmFuc2xhdGVkJwpwdXRzIGguaW5zcGVjdAoKcHV0cyAiLS0tLS0tLS0tLSIKCmRlZiBoYXNoX2J5X3JlY3Vyc2UobWF0Y2hlcywgaCkKICByZXR1cm4gaCBpZiBtYXRjaGVzLm5pbD8gfHwgbWF0Y2hlcy5zaXplID09IDAKICBoW21hdGNoZXMuZmlyc3RdIHx8PSB7fQogIGhhc2hfYnlfcmVjdXJzZShtYXRjaGVzWzEuLi0xXSwgaFttYXRjaGVzLmZpcnN0XSkKICBoCmVuZAoKaCA9IGhhc2hfYnlfcmVjdXJzZSgiYS5iLmMiLnNwbGl0KCcuJyksIHt9KQpwdXRzIGguaW5zcGVjdA==