locales_update.rb

Jean-Baptiste Barth, 2010-09-02 12:48

Download (212 Bytes)

 
1
#!/usr/bin/env ruby
2

    
3
Dir.glob("config/locales/*.yml") do |locale|
4
  puts "Fixing #{locale}"
5
  content = File.read(locale)
6
  File.open(locale, 'w') do |f|
7
    f.write content.gsub(/\{\{(.*?)}}/,'%{\1}')
8
  end
9
end