def iterate(hash, fhash = {}, path = "", outfile = $stdout)
hash.each do |key, val|
fhash[key] = {} unless fhash.key? key
if val.is_a? Hash
fhash[key] = {} unless fhash[key].is_a? Hash
def iterate(hash, fhash = {}, path = "", outfile = $stdout)
hash.each do |key, val|
fhash[key] = {} unless fhash.key? key
if val.is_a? Hash
fhash[key] = {} unless fhash[key].is_a? Hash
- iterate(val, fhash[key], path + key + ":", outfile)
+ iterate(val, fhash[key], "#{path}#{key}:#{outfile}")
- PO_DIR = LOCALE_DIR + "po/"
- Dir.mkdir(PO_DIR) unless File.directory?(PO_DIR)
- Dir.glob(LOCALE_DIR + "*.yml") do |filename|
+ po_dir = "#{LOCALE_DIR}po/"
+ Dir.mkdir(po_dir) unless File.directory?(po_dir)
+ Dir.glob("#{LOCALE_DIR}/*.yml") do |filename|
iterate(EN["en"], {}, "", outfile)
outfile.close
elsif opt
iterate(EN["en"], {}, "", outfile)
outfile.close
elsif opt