Skip to content

Commit

Permalink
Fix missing translations for collection labels (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
bess authored and little9 committed Aug 15, 2019
1 parent b63dbe1 commit 08e6401
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/tasks/fix_collection_labels.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true
# Run this if you are seeing Collections with a type of "translation missing..."
# Check YOUR_SERVER//dashboard/collections?locale=en for a place where this might appear
namespace :curate do
desc "Fix missing collection type labels"
task fix_collection_type_labels: :environment do
collection_types = Hyrax::CollectionType.all
collection_types.each do |c|
next unless c.title.match?(/^translation missing/)
oldtitle = c.title
c.title = I18n.t(c.title.gsub("translation missing: en.", ''))
c.save
puts "#{oldtitle} changed to #{c.title}"
end
end
end

0 comments on commit 08e6401

Please sign in to comment.