Sha256: b78de9cb4929cadc978804cb9a7e8b3ed5ad1ba59c7c0df9e105b4841ba80e13

Contents?: true

Size: 679 Bytes

Versions: 99

Compression:

Stored size: 679 Bytes

Contents

gettext_find_task = begin
                      Rake::Task['gettext:find']
                    rescue
                      nil
                    end

if gettext_find_task
  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

  gettext_find_task.enhance ['gettext:store_action_names']
end

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
foreman-tasks-0.15.4 lib/tasks/gettext.rake
foreman-tasks-0.15.3 lib/tasks/gettext.rake
foreman-tasks-0.15.2 lib/tasks/gettext.rake
foreman-tasks-0.15.1 lib/tasks/gettext.rake
foreman-tasks-0.15.0 lib/tasks/gettext.rake
foreman-tasks-0.14.5 lib/tasks/gettext.rake
foreman-tasks-0.14.4 lib/tasks/gettext.rake
foreman-tasks-0.14.3 lib/tasks/gettext.rake
foreman-tasks-0.14.2 lib/tasks/gettext.rake
foreman-tasks-0.14.1 lib/tasks/gettext.rake
foreman-tasks-0.11.3 lib/tasks/gettext.rake
foreman-tasks-0.14.0 lib/tasks/gettext.rake
foreman-tasks-0.13.4 lib/tasks/gettext.rake
foreman-tasks-0.13.3 lib/tasks/gettext.rake
foreman-tasks-0.13.2 lib/tasks/gettext.rake
foreman-tasks-0.13.1 lib/tasks/gettext.rake
foreman-tasks-0.13.0 lib/tasks/gettext.rake
foreman-tasks-0.12.2 lib/tasks/gettext.rake
foreman-tasks-0.11.2 lib/tasks/gettext.rake
foreman-tasks-0.12.1 lib/tasks/gettext.rake