Skip to content

Instantly share code, notes, and snippets.

@elskwid
Forked from ak47/gist:334309
Created March 16, 2010 18:17
Show Gist options
  • Save elskwid/334318 to your computer and use it in GitHub Desktop.
Save elskwid/334318 to your computer and use it in GitHub Desktop.
task :do_a_thing => :environment do
@zh_cn = " 联想"
@zh_tw = " 聯想"
%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', instance_variable_get("@#{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