]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge pull request #792 from eimlav/stringify
authorHelen <helen@puppetlabs.com>
Wed, 5 Sep 2018 10:10:57 +0000 (11:10 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Sep 2018 10:10:57 +0000 (11:10 +0100)
(FM-7318) - Added Puppet Strings formatting to documentation

25 files changed:
.fixtures.yml
.rubocop.yml
.rubocop_todo.yml
.sync.yml
Gemfile
Rakefile
lib/puppet/provider/apt_key/apt_key.rb
lib/puppet/type/apt_key.rb
locales/ja/puppetlabs-apt.po [new file with mode: 0644]
locales/puppetlabs-apt.pot [new file with mode: 0644]
manifests/backports.pp
manifests/conf.pp
manifests/init.pp
manifests/key.pp
manifests/params.pp
manifests/pin.pp
manifests/ppa.pp
manifests/setting.pp
manifests/source.pp
metadata.json
spec/acceptance/apt_key_provider_spec.rb
spec/defines/key_compat_spec.rb
spec/defines/key_spec.rb
spec/spec_helper_acceptance.rb
tasks/init.rb

index 0c221f0da7306aa9c8f020cfcd70fc146e5f175f..b419b4d716007b132ad970fbdbb544a44551b278 100644 (file)
@@ -2,5 +2,7 @@ fixtures:
   repositories:
     "stdlib":
       "repo": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
+    "translate": 
+      "repo": "https://github.com/puppetlabs/puppetlabs-translate"
   symlinks:
     "apt": "#{source_dir}"
index 54d1597aaa1a34941d39d88a8bb3be165ed01e64..ef3b9a56c2698eba61231d2db771c90032921883 100644 (file)
@@ -1,5 +1,7 @@
 ---
-require: rubocop-rspec
+require:
+- rubocop-i18n
+- rubocop-rspec
 AllCops:
   DisplayCopNames: true
   TargetRubyVersion: '2.1'
@@ -66,6 +68,7 @@ Style/TrailingCommaInLiteral:
 Style/SymbolArray:
   Description: Using percent style obscures symbolic intent of array's contents.
   EnforcedStyle: brackets
+inherit_from: ".rubocop_todo.yml"
 RSpec/MessageSpies:
   EnforcedStyle: receive
 Style/Documentation:
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..23d36faa4d7fd22e2a77cacad9d4c17a9fdaa625 100644 (file)
@@ -0,0 +1,2 @@
+GetText/DecorateString:
+  Enabled: false
\ No newline at end of file
index d4c7b223b1a36319e1423623cabcaf2ed9f9403d..ad63bcd99bddf7dc5b0bafd1166b3ab26a1014dd 100644 (file)
--- a/.sync.yml
+++ b/.sync.yml
@@ -25,6 +25,18 @@ Gemfile:
         git: 'https://github.com/skywinder/github-changelog-generator'
         ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
         condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
+      - gem: puppet-lint-i18n
+
+.rubocop.yml:
+   default_configs:
+    inherit_from: .rubocop_todo.yml
+    require:
+      - rubocop-i18n
+      - rubocop-rspec
+
+Rakefile:
+  requires:
+    - puppet_pot_generator/rake_tasks
 
 appveyor.yml:
   delete: true
diff --git a/Gemfile b/Gemfile
index 05cb6e6f34a7abaa9dbab0de6da457d63c6eb3b8..1aff7a8bcd9a14d6ccd740ffa57a579f092029e3 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -34,6 +34,7 @@ group :development do
   gem "puppet-module-win-default-r#{minor_version}",   require: false, platforms: [:mswin, :mingw, :x64_mingw]
   gem "puppet-module-win-dev-r#{minor_version}",       require: false, platforms: [:mswin, :mingw, :x64_mingw]
   gem "github_changelog_generator",                    require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
+  gem "puppet-lint-i18n",                              require: false
 end
 group :system_tests do
   gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
index 204fb18cdc93921bd5fd42edf660b53e874f7ef8..112dc4212b029e4b9ccb32b721b70301f92e294c 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -2,6 +2,7 @@ require 'puppetlabs_spec_helper/rake_tasks'
 require 'puppet-syntax/tasks/puppet-syntax'
 require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
 require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
+require 'puppet_pot_generator/rake_tasks'
 
 def changelog_user
   return unless Rake.application.top_level_tasks.include? "changelog"
index 1e54f3ccb4531e3a9a09ee7de920a77419efe49a..fbf232a766b8f12caf22f8f3725af80bb44908ef 100644 (file)
@@ -121,7 +121,7 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
   def source_to_file(value)
     parsed_value = URI.parse(value)
     if parsed_value.scheme.nil?
-      raise("The file #{value} does not exist") unless File.exist?(value)
+      raise(_('The file %{_value} does not exist') % { _value: value }) unless File.exist?(value)
       # Because the tempfile method has to return a live object to prevent GC
       # of the underlying file from occuring too early, we also have to return
       # a file object here.  The caller can still call the #path method on the
@@ -141,9 +141,9 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
           key = open(parsed_value, http_basic_authentication: user_pass).read
         end
       rescue OpenURI::HTTPError, Net::FTPPermError => e
-        raise("#{e.message} for #{resource[:source]}")
+        raise(_('%{_e} for %{_resource}') % { _e: e.message, _resource: resource[:source] })
       rescue SocketError
-        raise("could not resolve #{resource[:source]}")
+        raise(_('could not resolve %{_resource}') % { _resource: resource[:source] })
       else
         tempfile(key)
       end
@@ -170,7 +170,7 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
           end
         end
         unless found_match
-          raise("The id in your manifest #{resource[:name]} and the fingerprint from content/source don't match. Check for an error in the id and content/source is legitimate.")
+          raise(_('The id in your manifest %{_resource} and the fingerprint from content/source don\'t match. Check for an error in the id and content/source is legitimate.') % { _name: resource[:name] }) # rubocop:disable Metrics/LineLength
         end
       else
         warning('/usr/bin/gpg cannot be found for verification of the id.')
@@ -201,7 +201,7 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
       command.push('add', key_file.path)
     # In case we really screwed up, better safe than sorry.
     else
-      raise("an unexpected condition occurred while trying to add the key: #{resource[:id]}")
+      raise(_('an unexpected condition occurred while trying to add the key: %{_resource}') % { _resource: resource[:id] })
     end
     apt_key(command)
     @property_hash[:ensure] = :present
@@ -217,7 +217,7 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
   end
 
   def read_only(_value)
-    raise('This is a read-only property.')
+    raise(_('This is a read-only property.'))
   end
 
   mk_resource_methods
index c44aca092c654bf378e09b1972c43c73e757adc7..10bffb46e65ae50239783558f81c404889d6ef32 100644 (file)
@@ -23,10 +23,10 @@ Puppet::Type.newtype(:apt_key) do
 
   validate do
     if self[:content] && self[:source]
-      raise('The properties content and source are mutually exclusive.')
+      raise(_('The properties content and source are mutually exclusive.'))
     end
     if self[:id].length < 40
-      warning('The id should be a full fingerprint (40 characters), see README.')
+      warning(_('The id should be a full fingerprint (40 characters), see README.'))
     end
   end
 
diff --git a/locales/ja/puppetlabs-apt.po b/locales/ja/puppetlabs-apt.po
new file mode 100644 (file)
index 0000000..59a0613
--- /dev/null
@@ -0,0 +1,275 @@
+# #-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#
+# #-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"#-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"#-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 14:54:05 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 14:48+0100\n"
+"PO-Revision-Date: 2018-08-30 14:48+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 14:54:05 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 14:48+0100\n"
+"PO-Revision-Date: 2018-08-30 14:48+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 16:09:57 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 16:09+0100\n"
+"PO-Revision-Date: 2018-08-30 16:09+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+
+#. ./manifests/backports.pp:36
+msgid ""
+"If not on Debian or Ubuntu, you must explicitly pass location, release, "
+"repos, and key"
+msgstr ""
+"Īƒ ƞǿŧ ǿƞ Ḓḗƀīȧƞ ǿř Ŭƀŭƞŧŭ, ẏǿŭ ḿŭşŧ ḗẋƥŀīƈīŧŀẏ ƥȧşş ŀǿƈȧŧīǿƞ, řḗŀḗȧşḗ, "
+"řḗƥǿş, ȧƞḓ ķḗẏ"
+
+#. ./manifests/backports.pp:50
+msgid "pin must be either a string, number or hash"
+msgstr "ƥīƞ ḿŭşŧ ƀḗ ḗīŧħḗř ȧ şŧřīƞɠ, ƞŭḿƀḗř ǿř ħȧşħ"
+
+#. ./manifests/conf.pp:11
+msgid "Need to pass in content parameter"
+msgstr "Ƞḗḗḓ ŧǿ ƥȧşş īƞ ƈǿƞŧḗƞŧ ƥȧřȧḿḗŧḗř"
+
+#. ./manifests/init.pp:37 - ./manifests/params.pp:5
+msgid "This module only works on Debian or derivatives like Ubuntu"
+msgstr "Ŧħīş ḿǿḓŭŀḗ ǿƞŀẏ ẇǿřķş ǿƞ Ḓḗƀīȧƞ ǿř ḓḗřīṽȧŧīṽḗş ŀīķḗ Ŭƀŭƞŧŭ"
+
+#. ./manifests/params.pp:97
+msgid "Unable to determine value for fact os['name']"
+msgstr "Ŭƞȧƀŀḗ ŧǿ ḓḗŧḗřḿīƞḗ ṽȧŀŭḗ ƒǿř ƒȧƈŧ ǿş['ƞȧḿḗ']"
+
+#. ./manifests/pin.pp:52
+msgid "parameters release, origin, and version are mutually exclusive"
+msgstr "ƥȧřȧḿḗŧḗřş řḗŀḗȧşḗ, ǿřīɠīƞ, ȧƞḓ ṽḗřşīǿƞ ȧřḗ ḿŭŧŭȧŀŀẏ ḗẋƈŀŭşīṽḗ"
+
+#. ./manifests/pin.pp:56
+msgid "parameter version cannot be used in general form"
+msgstr "ƥȧřȧḿḗŧḗř ṽḗřşīǿƞ ƈȧƞƞǿŧ ƀḗ ŭşḗḓ īƞ ɠḗƞḗřȧŀ ƒǿřḿ"
+
+#. ./manifests/pin.pp:59
+msgid "parameters release and origin are mutually exclusive"
+msgstr "ƥȧřȧḿḗŧḗřş řḗŀḗȧşḗ ȧƞḓ ǿřīɠīƞ ȧřḗ ḿŭŧŭȧŀŀẏ ḗẋƈŀŭşīṽḗ"
+
+#. ./manifests/ppa.pp:10 - ./manifests/source.pp:25
+msgid "lsbdistcodename fact not available: release parameter required"
+msgstr "ŀşƀḓīşŧƈǿḓḗƞȧḿḗ ƒȧƈŧ ƞǿŧ ȧṽȧīŀȧƀŀḗ: řḗŀḗȧşḗ ƥȧřȧḿḗŧḗř řḗɋŭīřḗḓ"
+
+#. ./manifests/ppa.pp:14
+msgid "apt::ppa is not currently supported on Debian."
+msgstr "ȧƥŧ::ƥƥȧ īş ƞǿŧ ƈŭřřḗƞŧŀẏ şŭƥƥǿřŧḗḓ ǿƞ Ḓḗƀīȧƞ."
+
+#. ./manifests/setting.pp:11
+msgid "apt::setting cannot have both content and source"
+msgstr "ȧƥŧ::şḗŧŧīƞɠ ƈȧƞƞǿŧ ħȧṽḗ ƀǿŧħ ƈǿƞŧḗƞŧ ȧƞḓ şǿŭřƈḗ"
+
+#. ./manifests/setting.pp:15
+msgid "apt::setting needs either of content or source"
+msgstr "ȧƥŧ::şḗŧŧīƞɠ ƞḗḗḓş ḗīŧħḗř ǿƒ ƈǿƞŧḗƞŧ ǿř şǿŭřƈḗ"
+
+#. ./manifests/setting.pp:23
+msgid ""
+"apt::setting resource name/title must start with either 'conf-', 'pref-' or "
+"'list-'"
+msgstr ""
+"ȧƥŧ::şḗŧŧīƞɠ řḗşǿŭřƈḗ ƞȧḿḗ/title ḿŭşŧ şŧȧřŧ ẇīŧħ ḗīŧħḗř 'ƈǿƞƒ-', 'ƥřḗƒ-' ǿř "
+"'ŀīşŧ-'"
+
+#. ./manifests/setting.pp:29
+msgid "apt::setting priority must be an integer or a zero-padded integer"
+msgstr "ȧƥŧ::şḗŧŧīƞɠ ƥřīǿřīŧẏ ḿŭşŧ ƀḗ ȧƞ īƞŧḗɠḗř ǿř ȧ zḗřǿ-ƥȧḓḓḗḓ īƞŧḗɠḗř"
+
+#. ./manifests/source.pp:33
+msgid "cannot create a source entry without specifying a location"
+msgstr "ƈȧƞƞǿŧ ƈřḗȧŧḗ ȧ şǿŭřƈḗ ḗƞŧřẏ ẇīŧħǿŭŧ şƥḗƈīƒẏīƞɠ ȧ ŀǿƈȧŧīǿƞ"
+
+#. ./manifests/source.pp:47
+msgid "key hash must contain at least an id entry"
+msgstr "ķḗẏ ħȧşħ ḿŭşŧ ƈǿƞŧȧīƞ ȧŧ ŀḗȧşŧ ȧƞ īḓ ḗƞŧřẏ"
+
+#. ./manifests/source.pp:86
+msgid "Received invalid value for pin parameter"
+msgstr "Řḗƈḗīṽḗḓ īƞṽȧŀīḓ ṽȧŀŭḗ ƒǿř ƥīƞ ƥȧřȧḿḗŧḗř"
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:122
+msgid "The file %{_value} does not exist"
+msgstr "Ŧħḗ ƒīŀḗ %{_value} ḓǿḗş ƞǿŧ ḗẋīşŧ"
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:218
+msgid "This is a read-only property."
+msgstr "Ŧħīş īş ȧ řḗȧḓ-ǿƞŀẏ ƥřǿƥḗřŧẏ."
+
+#: ../lib/puppet/type/apt_key.rb:23
+msgid "The properties content and source are mutually exclusive."
+msgstr "Ŧħḗ ƥřǿƥḗřŧīḗş ƈǿƞŧḗƞŧ ȧƞḓ şǿŭřƈḗ ȧřḗ ḿŭŧŭȧŀŀẏ ḗẋƈŀŭşīṽḗ."
+
+#. metadata.json
+#: .summary
+msgid ""
+"Provides an interface for managing Apt source, key, and definitions with "
+"Puppet"
+msgstr ""
+"Ƥřǿṽīḓḗş ȧƞ īƞŧḗřƒȧƈḗ ƒǿř ḿȧƞȧɠīƞɠ Ȧƥŧ şǿŭřƈḗ, ķḗẏ, ȧƞḓ ḓḗƒīƞīŧīǿƞş ẇīŧħ "
+"Ƥŭƥƥḗŧ"
+
+#. ./manifests/params.pp:97
+msgid "Unable to determine value for fact os[\"name\"]"
+msgstr "Ŭƞȧƀŀḗ ŧǿ ḓḗŧḗřḿīƞḗ ṽȧŀŭḗ ƒǿř ƒȧƈŧ ǿş[\"ƞȧḿḗ\"]"
+
+#. ./manifests/key.pp:29
+msgid "key with id %{_id} already ensured as absent"
+msgstr "ķḗẏ ẇīŧħ īḓ %{_id} ȧŀřḗȧḓẏ ḗƞşŭřḗḓ ȧş ȧƀşḗƞŧ"
+
+#. ./manifests/key.pp:62
+msgid "key with id %{_id} already ensured as present"
+msgstr "ķḗẏ ẇīŧħ īḓ %{_id} ȧŀřḗȧḓẏ ḗƞşŭřḗḓ ȧş ƥřḗşḗƞŧ"
+
+#. ./manifests/key.pp:78
+msgid "Invalid 'ensure' value '%{_ensure}' for apt::key"
+msgstr "Īƞṽȧŀīḓ 'ḗƞşŭřḗ' ṽȧŀŭḗ '%{_ensure}' ƒǿř ȧƥŧ::ķḗẏ"
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:142
+msgid "%{_e} for %{_resource}"
+msgstr "%{_e} ƒǿř %{_resource}"
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:144
+msgid "could not resolve %{_resource}"
+msgstr "ƈǿŭŀḓ ƞǿŧ řḗşǿŀṽḗ %{_resource}"
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:171
+msgid ""
+"The id in your manifest %{_resource} and the fingerprint from content/source "
+"don't match. Check for an error in the id and content/source is legitimate."
+msgstr ""
+"Ŧħḗ īḓ īƞ ẏǿŭř ḿȧƞīƒḗşŧ %{_resource} ȧƞḓ ŧħḗ ƒīƞɠḗřƥřīƞŧ ƒřǿḿ ƈǿƞŧḗƞŧ/source "
+"ḓǿƞ'ŧ ḿȧŧƈħ. Ƈħḗƈķ ƒǿř ȧƞ ḗřřǿř īƞ ŧħḗ īḓ ȧƞḓ ƈǿƞŧḗƞŧ/source īş ŀḗɠīŧīḿȧŧḗ."
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:202
+msgid ""
+"an unexpected condition occurred while trying to add the key: %{_resource}"
+msgstr ""
+"ȧƞ ŭƞḗẋƥḗƈŧḗḓ ƈǿƞḓīŧīǿƞ ǿƈƈŭřřḗḓ ẇħīŀḗ ŧřẏīƞɠ ŧǿ ȧḓḓ ŧħḗ ķḗẏ: %{_resource}"
+
+#: ../lib/puppet/type/apt_key.rb:26
+msgid "The id should be a full fingerprint (40 characters), see README."
+msgstr "Ŧħḗ īḓ şħǿŭŀḓ ƀḗ ȧ ƒŭŀŀ ƒīƞɠḗřƥřīƞŧ (40 ƈħȧřȧƈŧḗřş), şḗḗ ŘḖȦḒḾḖ."
diff --git a/locales/puppetlabs-apt.pot b/locales/puppetlabs-apt.pot
new file mode 100644 (file)
index 0000000..e43d009
--- /dev/null
@@ -0,0 +1,266 @@
+# #-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#
+# #-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"#-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"#-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 14:54:05 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 14:48+0100\n"
+"PO-Revision-Date: 2018-08-30 14:48+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 14:54:05 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 14:48+0100\n"
+"PO-Revision-Date: 2018-08-30 14:48+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 16:09:57 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 16:09+0100\n"
+"PO-Revision-Date: 2018-08-30 16:09+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+
+#. ./manifests/backports.pp:36
+msgid ""
+"If not on Debian or Ubuntu, you must explicitly pass location, release, "
+"repos, and key"
+msgstr ""
+
+#. ./manifests/backports.pp:50
+msgid "pin must be either a string, number or hash"
+msgstr ""
+
+#. ./manifests/conf.pp:11
+msgid "Need to pass in content parameter"
+msgstr ""
+
+#. ./manifests/init.pp:37 - ./manifests/params.pp:5
+msgid "This module only works on Debian or derivatives like Ubuntu"
+msgstr ""
+
+#. ./manifests/params.pp:97
+msgid "Unable to determine value for fact os['name']"
+msgstr ""
+
+#. ./manifests/pin.pp:52
+msgid "parameters release, origin, and version are mutually exclusive"
+msgstr ""
+
+#. ./manifests/pin.pp:56
+msgid "parameter version cannot be used in general form"
+msgstr ""
+
+#. ./manifests/pin.pp:59
+msgid "parameters release and origin are mutually exclusive"
+msgstr ""
+
+#. ./manifests/ppa.pp:10 - ./manifests/source.pp:25
+msgid "lsbdistcodename fact not available: release parameter required"
+msgstr ""
+
+#. ./manifests/ppa.pp:14
+msgid "apt::ppa is not currently supported on Debian."
+msgstr ""
+
+#. ./manifests/setting.pp:11
+msgid "apt::setting cannot have both content and source"
+msgstr ""
+
+#. ./manifests/setting.pp:15
+msgid "apt::setting needs either of content or source"
+msgstr ""
+
+#. ./manifests/setting.pp:23
+msgid ""
+"apt::setting resource name/title must start with either 'conf-', 'pref-' or "
+"'list-'"
+msgstr ""
+
+#. ./manifests/setting.pp:29
+msgid "apt::setting priority must be an integer or a zero-padded integer"
+msgstr ""
+
+#. ./manifests/source.pp:33
+msgid "cannot create a source entry without specifying a location"
+msgstr ""
+
+#. ./manifests/source.pp:47
+msgid "key hash must contain at least an id entry"
+msgstr ""
+
+#. ./manifests/source.pp:86
+msgid "Received invalid value for pin parameter"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:122
+msgid "The file %{_value} does not exist"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:218
+msgid "This is a read-only property."
+msgstr ""
+
+#: ../lib/puppet/type/apt_key.rb:23
+msgid "The properties content and source are mutually exclusive."
+msgstr ""
+
+#. metadata.json
+#: .summary
+msgid ""
+"Provides an interface for managing Apt source, key, and definitions with "
+"Puppet"
+msgstr ""
+
+#. ./manifests/params.pp:97
+msgid "Unable to determine value for fact os[\"name\"]"
+msgstr ""
+
+#. ./manifests/key.pp:29
+msgid "key with id %{_id} already ensured as absent"
+msgstr ""
+
+#. ./manifests/key.pp:62
+msgid "key with id %{_id} already ensured as present"
+msgstr ""
+
+#. ./manifests/key.pp:78
+msgid "Invalid 'ensure' value '%{_ensure}' for apt::key"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:142
+msgid "%{_e} for %{_resource}"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:144
+msgid "could not resolve %{_resource}"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:171
+msgid ""
+"The id in your manifest %{_resource} and the fingerprint from content/source "
+"don't match. Check for an error in the id and content/source is legitimate."
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:202
+msgid ""
+"an unexpected condition occurred while trying to add the key: %{_resource}"
+msgstr ""
+
+#: ../lib/puppet/type/apt_key.rb:26
+msgid "The id should be a full fingerprint (40 characters), see README."
+msgstr ""
index a93e14f37eea07a2b64e4f123e168fe01a27e1c9..62927cdac7d1dada0a720dfac5b72a67a55a1e9e 100644 (file)
@@ -79,7 +79,7 @@ class apt::backports (
     }
   } else {
     unless $location and $release and $repos and $key {
-      fail('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key')
+      fail(translate('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key'))
     }
   }
 
@@ -93,7 +93,7 @@ class apt::backports (
       'release'  => $_release,
     }
   } else {
-    fail('pin must be either a string, number or hash')
+    fail(translate('pin must be either a string, number or hash'))
   }
 
   apt::source { 'backports':
index c27f0c1c0dcd683699caec9572739157468a57d7..9c1a59e81cffbfae1e64772853b0872f6da6a262 100644 (file)
@@ -22,7 +22,7 @@ define apt::conf (
 
   unless $ensure == 'absent' {
     unless $content {
-      fail('Need to pass in content parameter')
+      fail(translate('Need to pass in content parameter'))
     }
   }
 
index ff0d931acd4242e43c92c472b107df6fe1024ae6..f3472aca0097e6ce45505ca34587caf1327736ce 100644 (file)
@@ -140,7 +140,7 @@ class apt (
 ) inherits apt::params {
 
   if $facts['osfamily'] != 'Debian' {
-    fail('This module only works on Debian or derivatives like Ubuntu')
+    fail(translate('This module only works on Debian or derivatives like Ubuntu'))
   }
 
   if $update['frequency'] {
index cb95b4d38cda8090410813d4917a69a693c8b779..93cc27dab0b9dd09b1075cde5a66cc556cc2d15a 100644 (file)
 #   Passes additional options to `apt-key adv --keyserver-options`.
 #
 define apt::key (
-    String $id                           = $title,
-    Enum['present', 'absent'] $ensure    = present,
-    Optional[String] $content            = undef,
-    Optional[String] $source             = undef,
-    String $server                       = $::apt::keyserver,
-    Optional[String] $options            = undef,
-    ) {
-
-  assert_type(
-    Pattern[
-      /\A(0x)?[0-9a-fA-F]{8}\Z/,
-      /\A(0x)?[0-9a-fA-F]{16}\Z/,
-      /\A(0x)?[0-9a-fA-F]{40}\Z/,
-    ], $id)
-
-  if $source {
-    assert_type(Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/], $source)
-  }
-
-  if $server {
-    assert_type(Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/], $server)
-  }
+  Pattern[/\A(0x)?[0-9a-fA-F]{8}\Z/, /\A(0x)?[0-9a-fA-F]{16}\Z/, /\A(0x)?[0-9a-fA-F]{40}\Z/] $id = $title,
+  Enum['present', 'absent'] $ensure                                                              = present,
+  Optional[String] $content                                                                      = undef,
+  Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]] $source                            = undef,
+  Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/] $server  = $::apt::keyserver,
+  Optional[String] $options                                                                      = undef,
+  ) {
 
   case $ensure {
     present: {
       if defined(Anchor["apt_key ${id} absent"]){
-        fail("key with id ${id} already ensured as absent")
+        fail(translate('key with id %{_id} already ensured as absent'),{'_id' => id})
       }
 
       if !defined(Anchor["apt_key ${id} present"]) {
@@ -91,7 +76,7 @@ define apt::key (
 
     absent: {
       if defined(Anchor["apt_key ${id} present"]){
-        fail("key with id ${id} already ensured as present")
+        fail(translate('key with id %{_id} already ensured as present', {'_id' => id}))
       }
 
       if !defined(Anchor["apt_key ${id} absent"]){
@@ -107,7 +92,7 @@ define apt::key (
     }
 
     default: {
-      fail "Invalid 'ensure' value '${ensure}' for apt::key"
+      fail translate('Invalid \'ensure\' value \'%{_ensure}\' for apt::key', {'_ensure' => ensure})
     }
   }
 }
index 196bb0ebf6274506427a7abc55557d5284676e30..ae26a7dfda57248a5a02b22fb0a7073b44e855d0 100644 (file)
@@ -5,7 +5,7 @@
 class apt::params {
 
   if $::osfamily != 'Debian' {
-    fail('This module only works on Debian or derivatives like Ubuntu')
+    fail(translate('This module only works on Debian or derivatives like Ubuntu'))
   }
 
   $root           = '/etc/apt'
@@ -97,7 +97,7 @@ class apt::params {
       $ppa_package        = 'software-properties-common'
     }
     undef: {
-      fail('Unable to determine value for fact os["name"]')
+      fail(translate('Unable to determine value for fact os[\"name\"]'))
     }
     default: {
       $ppa_options = undef
index 9310653b2d77ea4887a10a022531e8c7599cca2e..8145b7d4b6575c024c1435e803beb5ebda6ea334 100644 (file)
@@ -81,14 +81,14 @@ define apt::pin(
   if $packages_string != '*' { # specific form
     if ( $pin_release != '' and ( $origin != '' or $version != '' )) or
       ( $version != '' and ( $pin_release != '' or $origin != '' )) {
-      fail('parameters release, origin, and version are mutually exclusive')
+      fail(translate('parameters release, origin, and version are mutually exclusive'))
     }
   } else { # general form
     if $version != '' {
-      fail('parameter version cannot be used in general form')
+      fail(translate('parameter version cannot be used in general form'))
     }
     if ( $pin_release != '' and $origin != '' ) {
-      fail('parameters release and origin are mutually exclusive')
+      fail(translate('parameters release and origin are mutually exclusive'))
     }
   }
 
index bdc3593be845de50353198bc77cc0fc40a0d5b0b..402961a72a949631b9ba6ebaed7b104abefdefca 100644 (file)
@@ -27,11 +27,11 @@ define apt::ppa(
   Boolean $package_manage        = false,
 ) {
   unless $release {
-    fail('lsbdistcodename fact not available: release parameter required')
+    fail(translate('lsbdistcodename fact not available: release parameter required'))
   }
 
   if $facts['lsbdistid'] == 'Debian' {
-    fail('apt::ppa is not currently supported on Debian.')
+    fail(translate('apt::ppa is not currently supported on Debian.'))
   }
 
   if versioncmp($facts['lsbdistrelease'], '14.10') >= 0 {
index e743a5c2de80b17202d8546d0d76f16a70535582..4729295d0d3e4fe84bef7667d1caa2bbf3c0108b 100644 (file)
@@ -28,11 +28,11 @@ define apt::setting (
 ) {
 
   if $content and $source {
-    fail('apt::setting cannot have both content and source')
+    fail(translate('apt::setting cannot have both content and source'))
   }
 
   if !$content and !$source {
-    fail('apt::setting needs either of content or source')
+    fail(translate('apt::setting needs either of content or source'))
   }
 
   $title_array = split($title, '-')
@@ -40,13 +40,13 @@ define apt::setting (
   $base_name = join(delete_at($title_array, 0), '-')
 
   assert_type(Pattern[/\Aconf\z/, /\Apref\z/, /\Alist\z/], $setting_type) |$a, $b| {
-    fail("apt::setting resource name/title must start with either 'conf-', 'pref-' or 'list-'")
+    fail(translate("apt::setting resource name/title must start with either 'conf-', 'pref-' or 'list-'"))
   }
 
   if $priority !~ Integer {
     # need this to allow zero-padded priority.
     assert_type(Pattern[/^\d+$/], $priority) |$a, $b| {
-      fail('apt::setting priority must be an integer or a zero-padded integer')
+      fail(translate('apt::setting priority must be an integer or a zero-padded integer'))
     }
   }
 
index 9ccad35b119dcdaf27e6b3a13a7c43fdd9d857d2..cca03e97527ce921e93afc89db49d33c461a3580 100644 (file)
@@ -76,7 +76,7 @@ define apt::source(
     if $facts['lsbdistcodename'] {
       $_release = $facts['lsbdistcodename']
     } else {
-      fail('lsbdistcodename fact not available: release parameter required')
+      fail(translate('lsbdistcodename fact not available: release parameter required'))
     }
   } else {
     $_release = $release
@@ -84,7 +84,7 @@ define apt::source(
 
   if $ensure == 'present' {
     if ! $location {
-      fail('cannot create a source entry without specifying a location')
+      fail(translate('cannot create a source entry without specifying a location'))
     }
     # Newer oses, do not need the package for HTTPS transport.
     $_transport_https_releases = [ 'wheezy', 'jessie', 'stretch', 'trusty', 'xenial' ]
@@ -98,7 +98,7 @@ define apt::source(
   if $key {
     if $key =~ Hash {
       unless $key['id'] {
-        fail('key hash must contain at least an id entry')
+        fail(translate('key hash must contain at least an id entry'))
       }
       $_key = merge($::apt::source_key_defaults, $key)
     } else {
@@ -137,7 +137,7 @@ define apt::source(
         'origin'   => $host,
       }
     } else {
-      fail('Received invalid value for pin parameter')
+      fail(translate('Received invalid value for pin parameter'))
     }
     create_resources('apt::pin', { "${name}" => $_pin })
   }
index d637afd40e775b19be6075b39c89be7794ff3565..b8b9518d86e6f8f8947a039e83a34be657e51741 100644 (file)
     {
       "name": "puppetlabs/stdlib",
       "version_requirement": ">= 4.16.0 < 6.0.0"
+    },
+    {
+      "name": "puppetlabs/translate",
+      "version_requirement": ">= 1.0.0 < 2.0.0"
     }
   ],
   "operatingsystem_support": [
index de3be330219b70358aacf582b7598d09d9f6e78b..712fa5a8715bb52e518c401b84a7a86e942b94b3 100644 (file)
@@ -716,6 +716,22 @@ describe 'apt_key' do
           expect(r.stderr).to match(%r{could not resolve})
         end
       end
+
+      it 'fails with a socket error - i18n' do
+        hosts.each do |host|
+          on(host, "sed -i \"96i FastGettext.locale='ja'\" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb")
+          change_locale_on(host, 'ja_JP.utf-8')
+        end
+
+        apply_manifest(socket_error_pp, expect_failures: true) do |r|
+          expect(r.stderr).to match(%r{ƈǿŭŀḓ ƞǿŧ řḗşǿŀṽḗ})
+        end
+
+        hosts.each do |host|
+          on(host, 'sed -i "96d" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb')
+          change_locale_on(host, 'en_US')
+        end
+      end
     end
 
     # disabled when running in travis, security issues prevent FTP
@@ -741,6 +757,22 @@ describe 'apt_key' do
           expect(r.stderr).to match(%r{could not resolve})
         end
       end
+
+      it 'fails with a socket error - i18n' do
+        hosts.each do |host|
+          on(host, "sed -i \"96i FastGettext.locale='ja'\" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb")
+          change_locale_on(host, 'ja_JP.utf-8')
+        end
+
+        apply_manifest(ftp_socket_error_pp, expect_failures: true) do |r|
+          expect(r.stderr).to match(%r{ƈǿŭŀḓ ƞǿŧ řḗşǿŀṽḗ})
+        end
+
+        hosts.each do |host|
+          on(host, 'sed -i "96d" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb')
+          change_locale_on(host, 'en_US')
+        end
+      end
     end
 
     context 'with https://' do
@@ -765,6 +797,22 @@ describe 'apt_key' do
           expect(r.stderr).to match(%r{could not resolve})
         end
       end
+
+      it 'fails with a socket error - i18n' do
+        hosts.each do |host|
+          on(host, "sed -i \"96i FastGettext.locale='ja'\" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb")
+          change_locale_on(host, 'ja_JP.utf-8')
+        end
+
+        apply_manifest(https_socket_error_pp, expect_failures: true) do |r|
+          expect(r.stderr).to match(%r{ƈǿŭŀḓ ƞǿŧ řḗşǿŀṽḗ})
+        end
+
+        hosts.each do |host|
+          on(host, 'sed -i "96d" /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb')
+          change_locale_on(host, 'en_US')
+        end
+      end
     end
 
     context 'with /path/that/exists' do
index aee585588c1d2e08cddd4c433db61e43db41a066..ae247d2768b2f3bb0ac561eea21200a8300b3574 100644 (file)
@@ -271,7 +271,7 @@ describe 'apt::key', type: :define do
       end
 
       it 'fails' do
-        is_expected.to raise_error(%r{expects a match})
+        is_expected.to raise_error(%r{evaluating a Resource})
       end
     end
 
index d1960630e89e95cc2242a4d4ce49453226e91ce4..b4ccf1682b51a3310244ef548e2e2a45d91551ba 100644 (file)
@@ -276,7 +276,7 @@ describe 'apt::key' do
       end
 
       it 'fails' do
-        is_expected.to raise_error(%r{expects a match})
+        is_expected.to raise_error(%r{evaluating a Resource})
       end
     end
 
index f51bd88df93834f4e4fb1cad45e39f3fa9b9c44f..a7bd4f441ca7be72d6cbfd8f308e601d448edafb 100644 (file)
@@ -4,6 +4,8 @@ require 'beaker-rspec'
 require 'beaker/puppet_install_helper'
 require 'beaker/module_install_helper'
 require 'beaker-task_helper'
+require 'beaker/i18n_helper'
+require 'beaker-task_helper'
 
 run_puppet_install_helper
 configure_type_defaults_on(hosts)
@@ -49,5 +51,27 @@ RSpec.configure do |c|
   # Configure all nodes in nodeset
   c.before :suite do
     run_puppet_access_login(user: 'admin') if pe_install? && puppet_version =~ %r{(5\.\d\.\d)}
+
+    hosts.each do |host|
+      # This will be removed, this is temporary to test localisation.
+      if (fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat') &&
+         (Gem::Version.new(puppet_version) >= Gem::Version.new('4.10.5') &&
+          Gem::Version.new(puppet_version) < Gem::Version.new('5.2.0'))
+        on(host, 'mkdir /opt/puppetlabs/puppet/share/locale/ja')
+        on(host, 'touch /opt/puppetlabs/puppet/share/locale/ja/puppet.po')
+      end
+      if fact('osfamily') == 'Debian'
+        # install language on debian systems
+        install_language_on(host, 'ja_JP.utf-8') if not_controller(host)
+        # This will be removed, this is temporary to test localisation.
+      end
+      # Required for binding tests.
+      if fact('osfamily') == 'RedHat'
+        if fact('operatingsystemmajrelease') =~ %r{7} || fact('operatingsystem') =~ %r{Fedora}
+          shell('yum install -y bzip2')
+        end
+      end
+      on host, puppet('module', 'install', 'stahnma/epel')
+    end
   end
 end
index ebcf72adddee590f91516a756b07aadeccb16857..b4cb0dc7622744be6334972eeb720ae1d89faf08 100755 (executable)
@@ -7,7 +7,7 @@ def apt_get(action)
   cmd = ['apt-get', action]
   cmd << '-y' if action == 'upgrade'
   stdout, stderr, status = Open3.capture3(*cmd)
-  raise Puppet::Error, stderr if status != 0
+  raise Puppet::Error, stderr if status != 0 # rubocop:disable GetText/DecorateFunctionMessage
   { status: stdout.strip }
 end