Skip to content

Instantly share code, notes, and snippets.

View ruby24's full-sized avatar

ruby24

  • bit4coin
View GitHub Profile
@johnnypez
johnnypez / sync_locales
Created August 19, 2013 20:21
syncs keys from en.yml to other exisiting locale files
#!/usr/bin/env ruby
require 'yaml'
require 'active_support'
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/../')
files = Dir.glob("#{RAILS_ROOT}/config/locales/*.yml")
locales = files.map{|f| File.basename(f, '.yml')}
def flat_hash(hash, k = nil)