namespace :gettext do task :store_action_names => :environment do storage_file = "#{locale_path}/action_names.rb" puts "writing action translations to: #{storage_file}" File.write storage_file, "# Autogenerated!\n" + Actions::EntryAction. all_action_names. uniq. map { |n| %[_("#{n}")] }. join("\n") end end Rake::Task['gettext:find'].enhance ['gettext:store_action_names']