commit rubygem-i18n for openSUSE:Factory
Hello community, here is the log from the commit of package rubygem-i18n for openSUSE:Factory checked in at 2018-08-18 00:03:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-i18n (Old) and /work/SRC/openSUSE:Factory/.rubygem-i18n.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-i18n" Sat Aug 18 00:03:59 2018 rev:20 rq:629491 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-i18n/rubygem-i18n.changes 2018-04-19 15:33:06.346137111 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-i18n.new/rubygem-i18n.changes 2018-08-18 00:04:00.343057981 +0200 @@ -1,0 +2,17 @@ +Thu Aug 16 06:50:16 UTC 2018 - mschnitzer@suse.com + +- updated to version 1.1.0 + + * Simplified default exception handler - #414 + * Fallbacks now exclude default locale - #415, possibly fixes #413 + #338 + * Fixed deprecated use of assert_nothing_raised #417 + * Fixed pluralization behavior for KeyValue backend with subtrees disabled - #419 + * Allow yaml file extension - #421 + +------------------------------------------------------------------- +Thu Apr 19 09:05:12 UTC 2018 - factory-auto@kulow.org + +- updated to version 1.0.1 + no changelog found + +------------------------------------------------------------------- Old: ---- i18n-1.0.1.gem New: ---- i18n-1.1.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-i18n.spec ++++++ --- /var/tmp/diff_new_pack.s82kSW/_old 2018-08-18 00:04:00.839059464 +0200 +++ /var/tmp/diff_new_pack.s82kSW/_new 2018-08-18 00:04:00.843059475 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-i18n -Version: 1.0.1 +Version: 1.1.0 Release: 0 %define mod_name i18n %define mod_full_name %{mod_name}-%{version} ++++++ i18n-1.0.1.gem -> i18n-1.1.0.gem ++++++ Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/i18n/backend/base.rb new/lib/i18n/backend/base.rb --- old/lib/i18n/backend/base.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/lib/i18n/backend/base.rb 2018-08-08 00:15:04.000000000 +0200 @@ -234,6 +234,7 @@ raise InvalidLocaleData.new(filename, e.inspect) end end + alias_method :load_yaml, :load_yml def translate_localization_format(locale, object, format, options) format.to_s.gsub(/%[aAbBpP]/) do |match| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/i18n/backend/key_value.rb new/lib/i18n/backend/key_value.rb --- old/lib/i18n/backend/key_value.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/lib/i18n/backend/key_value.rb 2018-08-08 00:15:04.000000000 +0200 @@ -127,6 +127,7 @@ if subtrees? super else + return entry unless entry.is_a?(Hash) key = pluralization_key(entry, count) entry[key] end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/i18n/exceptions.rb new/lib/i18n/exceptions.rb --- old/lib/i18n/exceptions.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/lib/i18n/exceptions.rb 2018-08-08 00:15:04.000000000 +0200 @@ -3,23 +3,14 @@ require 'cgi' module I18n - # Handles exceptions raised in the backend. All exceptions except for - # MissingTranslationData exceptions are re-thrown. When a MissingTranslationData - # was caught the handler returns an error message string containing the key/scope. - # Note that the exception handler is not called when the option :throw was given. class ExceptionHandler - include Module.new { - def call(exception, locale, key, options) - case exception - when MissingTranslation - exception.message - when Exception - raise exception - else - throw :exception, exception - end + def call(exception, _locale, _key, _options) + if exception.is_a?(MissingTranslation) + exception.message + else + raise exception end - } + end end class ArgumentError < ::ArgumentError; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/i18n/locale/fallbacks.rb new/lib/i18n/locale/fallbacks.rb --- old/lib/i18n/locale/fallbacks.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/lib/i18n/locale/fallbacks.rb 2018-08-08 00:15:04.000000000 +0200 @@ -56,7 +56,7 @@ def initialize(*mappings) @map = {} map(mappings.pop) if mappings.last.is_a?(Hash) - self.defaults = mappings.empty? ? [I18n.default_locale.to_sym] : mappings + self.defaults = mappings.empty? ? [] : mappings end def defaults=(defaults) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/i18n/tests/interpolation.rb new/lib/i18n/tests/interpolation.rb --- old/lib/i18n/tests/interpolation.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/lib/i18n/tests/interpolation.rb 2018-08-08 00:15:04.000000000 +0200 @@ -43,7 +43,7 @@ end test "interpolation: it does not raise I18n::MissingInterpolationArgument for escaped variables" do - assert_nothing_raised(I18n::MissingInterpolationArgument) do + assert_nothing_raised do assert_equal 'Barr %{foo}', interpolate(:default => '%{bar} %%{foo}', :bar => 'Barr') end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/i18n/version.rb new/lib/i18n/version.rb --- old/lib/i18n/version.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/lib/i18n/version.rb 2018-08-08 00:15:04.000000000 +0200 @@ -1,5 +1,5 @@ # frozen_string_literal: true module I18n - VERSION = "1.0.1" + VERSION = "1.1.0" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2018-04-18 06:56:28.000000000 +0200 +++ new/metadata 2018-08-08 00:15:04.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: i18n version: !ruby/object:Gem::Version - version: 1.0.1 + version: 1.1.0 platform: ruby authors: - Sven Fuchs @@ -13,7 +13,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2018-04-18 00:00:00.000000000 Z +date: 2018-08-07 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: concurrent-ruby @@ -126,6 +126,7 @@ - test/run_all.rb - test/test_data/locales/de.po - test/test_data/locales/en.rb +- test/test_data/locales/en.yaml - test/test_data/locales/en.yml - test/test_data/locales/invalid/empty.yml - test/test_data/locales/invalid/syntax.yml @@ -151,7 +152,7 @@ version: 1.3.5 requirements: [] rubyforge_project: "[none]" -rubygems_version: 2.7.4 +rubygems_version: 2.7.3 signing_key: specification_version: 4 summary: New wave Internationalization support for Ruby diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/backend/fallbacks_test.rb new/test/backend/fallbacks_test.rb --- old/test/backend/fallbacks_test.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/test/backend/fallbacks_test.rb 2018-08-08 00:15:04.000000000 +0200 @@ -24,18 +24,10 @@ assert_equal 'Interpolate %{value}', I18n.t(:interpolate) end - test "returns the :en translation for a missing :de translation" do - assert_equal 'Foo in :en', I18n.t(:foo, :locale => :de) - end - test "returns the :de translation for a missing :'de-DE' translation" do assert_equal 'Bar in :de', I18n.t(:bar, :locale => :'de-DE') end - test "returns the :en translation for translation missing in both :de and :'de-De'" do - assert_equal 'Buz in :en', I18n.t(:buz, :locale => :'de-DE') - end - test "returns the :de translation for a missing :'de-DE' when :default is a String" do assert_equal 'Bar in :de', I18n.t(:bar, :locale => :'de-DE', :default => "Default Bar") assert_equal "Default Bar", I18n.t(:missing_bar, :locale => :'de-DE', :default => "Default Bar") @@ -106,6 +98,11 @@ I18n.enforce_available_locales = false end end + + test "returns fallback default given missing pluralization data" do + assert_equal 'default', I18n.t(:missing_bar, count: 1, default: 'default') + assert_equal 'default', I18n.t(:missing_bar, count: 0, default: 'default') + end end class I18nBackendFallbacksLocalizeTest < I18n::TestCase @@ -117,18 +114,13 @@ super I18n.backend = Backend.new store_translations(:en, :date => { :formats => { :en => 'en' }, :day_names => %w(Sunday) }) - store_translations(:de, :date => { :formats => { :de => 'de' } }) + store_translations(:de, :date => { :formats => { :de => 'de' }, :day_names => %w(Sunday) }) end test "still uses an existing format as usual" do assert_equal 'en', I18n.l(Date.today, :format => :en, :locale => :en) end - - test "looks up and uses a fallback locale's format for a key missing in the given locale (1)" do - assert_equal 'en', I18n.l(Date.today, :format => :en, :locale => :de) - end - - test "looks up and uses a fallback locale's format for a key missing in the given locale (2)" do + test "looks up and uses a fallback locale's format for a key missing in the given locale" do assert_equal 'de', I18n.l(Date.today, :format => :de, :locale => :'de-DE') end @@ -137,7 +129,7 @@ end test "uses a fallback locale's translation for a key missing in the given locale" do - assert_equal 'Sunday', I18n.l(Date.new(2010, 1, 3), :format => '%A', :locale => :de) + assert_equal 'Sunday', I18n.l(Date.new(2010, 1, 3), :format => '%A', :locale => :'de-DE') end end @@ -208,8 +200,8 @@ end test "exists? should return true given a key which is missing from the given locale and exists in a fallback locale" do - assert_equal true, I18n.exists?(:foo, :de) - assert_equal true, I18n.exists?(:foo, :'de-DE') + assert_equal true, I18n.exists?(:bar, :de) + assert_equal true, I18n.exists?(:bar, :'de-DE') end test "exists? should return false given a key which is missing from the given locale and all its fallback locales" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/backend/key_value_test.rb new/test/backend/key_value_test.rb --- old/test/backend/key_value_test.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/test/backend/key_value_test.rb 2018-08-08 00:15:04.000000000 +0200 @@ -58,4 +58,28 @@ store_translations(:en, :bar => { :one => "One" }) assert_equal("One", I18n.t("bar", :count => 1)) end + + test "subtrees enabled: returns localized string given missing pluralization data" do + setup_backend!(true) + assert_equal 'bar', I18n.t("foo.bar", count: 1) + end + + test "subtrees disabled: returns localized string given missing pluralization data" do + setup_backend!(false) + assert_equal 'bar', I18n.t("foo.bar", count: 1) + end + + test "subtrees enabled: Returns fallback default given missing pluralization data" do + setup_backend!(true) + I18n.backend.extend I18n::Backend::Fallbacks + assert_equal 'default', I18n.t(:missing_bar, count: 1, default: 'default') + assert_equal 'default', I18n.t(:missing_bar, count: 0, default: 'default') + end + + test "subtrees disabled: Returns fallback default given missing pluralization data" do + setup_backend!(false) + I18n.backend.extend I18n::Backend::Fallbacks + assert_equal 'default', I18n.t(:missing_bar, count: 1, default: 'default') + assert_equal 'default', I18n.t(:missing_bar, count: 0, default: 'default') + end end if I18n::TestCase.key_value? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/backend/simple_test.rb new/test/backend/simple_test.rb --- old/test/backend/simple_test.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/test/backend/simple_test.rb 2018-08-08 00:15:04.000000000 +0200 @@ -17,6 +17,10 @@ assert_raise(I18n::UnknownFileType) { I18n.backend.load_translations("#{locales_dir}/en.xml") } end + test "simple load_translations: given a YAML file name with yaml extension does not raise anything" do + assert_nothing_raised { I18n.backend.load_translations("#{locales_dir}/en.yaml") } + end + test "simple load_translations: given a Ruby file name it does not raise anything" do assert_nothing_raised { I18n.backend.load_translations("#{locales_dir}/en.rb") } end @@ -100,4 +104,8 @@ I18n.backend.reload! assert_equal false, I18n.backend.initialized? end + + test "returns localized string given missing pluralization data" do + assert_equal 'baz', I18n.t('foo.bar', count: 1) + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/locale/fallbacks_test.rb new/test/locale/fallbacks_test.rb --- old/test/locale/fallbacks_test.rb 2018-04-18 06:56:28.000000000 +0200 +++ new/test/locale/fallbacks_test.rb 2018-08-08 00:15:04.000000000 +0200 @@ -3,10 +3,10 @@ include I18n::Locale class I18nFallbacksDefaultsTest < I18n::TestCase - test "defaults reflect the I18n.default_locale if no default has been set manually" do + test "defaults to an empty array if no default has been set manually" do I18n.default_locale = :'en-US' fallbacks = Fallbacks.new - assert_equal [:'en-US', :en], fallbacks.defaults + assert_equal [], fallbacks.defaults end test "defaults reflect a manually passed default locale if any" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_data/locales/en.yaml new/test/test_data/locales/en.yaml --- old/test/test_data/locales/en.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/test/test_data/locales/en.yaml 2018-08-08 00:15:04.000000000 +0200 @@ -0,0 +1,3 @@ +en: + foo: + bar: baz \ No newline at end of file
participants (1)
-
root