Skip to content

Instantly share code, notes, and snippets.

@ak47
Created March 16, 2010 18:06
Show Gist options
  • Save ak47/334307 to your computer and use it in GitHub Desktop.
Save ak47/334307 to your computer and use it in GitHub Desktop.
task :do_a_thing => :environment do
def zh_cn; " 联想"; end
def zh_tw; " 聯想"; end
%w( zh-cn zh-tw ).each do |chinese|
lang = Language.find_by_language_code(chinese)
LocalizedString.all(:conditions => ["language_id = ? and string_value like '%FindMe%'", lang.id]).each do |loc|
loc.string_value.gsub!('FindMe', send(chinese.underscore))
loc.save_without_validation
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment