Skip to content

Commit

Permalink
Remove i18n/gettext task
Browse files Browse the repository at this point in the history
puppetlabs/gettext-setup-gem is unmaintained and we don't support
module translations anymore. Remove this code and dependency to avoid
pulling in the gem into the PDK.
DavidS committed Feb 9, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7579a28 commit f98ccc0
Showing 2 changed files with 0 additions and 24 deletions.
23 changes: 0 additions & 23 deletions lib/puppetlabs_spec_helper/rake_tasks.rb
Original file line number Diff line number Diff line change
@@ -345,29 +345,6 @@
end
end

module_dir = Dir.pwd
locales_dir = File.absolute_path('locales', module_dir)
# if the task is allowed to run when the module does not have a locales directory,
# the task is run in the puppet gem instead and creates a POT there.
puts 'gettext-setup tasks will only be loaded if the locales/ directory is present' if Rake.verbose == true
if File.exist? locales_dir
begin
spec = Gem::Specification.find_by_name 'gettext-setup'
load "#{spec.gem_dir}/lib/tasks/gettext.rake"
# Initialization requires a valid locales directory
GettextSetup.initialize(locales_dir)
namespace :module do
desc 'Runs all tasks to build a modules POT file for internationalization'
task :pot_gen do
Rake::Task['gettext:pot'].invoke
Rake::Task['gettext:metadata_pot'].invoke("#{module_dir}/metadata.json")
end
end
rescue Gem::LoadError
puts 'No gettext-setup gem found, skipping GettextSetup config initialization' if Rake.verbose == true
end
end

def create_gch_task(changelog_user = nil, changelog_project = nil, changelog_since_tag = nil, changelog_tag_pattern = 'v%s')
if Bundler.rubygems.find_name('github_changelog_generator').any?
# needed a place to hide these methods
1 change: 0 additions & 1 deletion puppetlabs_spec_helper.gemspec
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'fakefs', ['>= 0.13.3', '< 2']
spec.add_development_dependency 'gettext-setup', '~> 0.29'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'puppet'
spec.add_development_dependency 'rake', ['>= 10.0', '< 14']

0 comments on commit f98ccc0

Please sign in to comment.