ary='a.b.c.d'.split('.').reversehsh={ary.shift=>'untranslated'}hsh={ary.shift=>hsh} until ary.empty?p hsh
Standard input is empty
{"a"=>{"b"=>{"c"=>{"d"=>"untranslated"}}}}
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!