1 2 3 4 5
tokens = match.split('.') last = tokens[0..-2].inject(h) do |h, scope| h[scope] ||= {} end last[tokens.last] = 'untranslated'