From 9e1c4d53d9056b662849d5950a56ec3d5ebb8027 Mon Sep 17 00:00:00 2001 From: David Swan Date: Fri, 31 Aug 2018 14:24:35 +0100 Subject: [PATCH] (FM-7316) - i18n Implementation Tests Made --- locales/ja/puppetlabs-apt.po | 275 +++++++++++++++++++++++ spec/acceptance/apt_key_provider_spec.rb | 48 ++++ spec/spec_helper_acceptance.rb | 24 ++ 3 files changed, 347 insertions(+) create mode 100644 locales/ja/puppetlabs-apt.po diff --git a/locales/ja/puppetlabs-apt.po b/locales/ja/puppetlabs-apt.po new file mode 100644 index 0000000..59a0613 --- /dev/null +++ b/locales/ja/puppetlabs-apt.po @@ -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 , 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 , 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 , 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 \n" +"Language-Team: LANGUAGE \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 \n" +"Language-Team: LANGUAGE \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 \n" +"Language-Team: LANGUAGE \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 \n" +"Language-Team: LANGUAGE \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 \n" +"Language-Team: LANGUAGE \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 \n" +"Language-Team: LANGUAGE \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 \n" +"Language-Team: LANGUAGE \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 \n" +"Language-Team: LANGUAGE \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 \n" +"Language-Team: LANGUAGE \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/spec/acceptance/apt_key_provider_spec.rb b/spec/acceptance/apt_key_provider_spec.rb index aa78001..912e35a 100644 --- a/spec/acceptance/apt_key_provider_spec.rb +++ b/spec/acceptance/apt_key_provider_spec.rb @@ -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 diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index f51bd88..a7bd4f4 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -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 -- 2.45.2