lib/tasks/gettext.rake in foreman-tasks-9.0.0 vs lib/tasks/gettext.rake in foreman-tasks-9.0.1
- old
+ new
@@ -8,15 +8,21 @@
namespace :gettext do
task :store_action_names => :environment do
storage_file = "#{locale_path}/action_names.rb"
puts "writing action translations to: #{storage_file}"
+ klasses = Actions::EntryAction
+ .subclasses
+ .uniq
+ .select do |action|
+ src, = Object.const_source_location(action.to_s)
+ src.start_with? @engine.root.to_s
+ end
+
File.write storage_file,
"# Autogenerated!\n" +
- Actions::EntryAction
- .all_action_names
- .uniq
- .map { |n| %[_("#{n}")] }
+ klasses
+ .map { |klass| %[_("#{klass.allocate.humanized_name}")] }
.sort
.join("\n") + "\n"
end
end