gettext_i18n_rails 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e54b27b13a1bc165ba1d15d79124499d2adf0560db0a6b15fd03561568cdf23c
4
- data.tar.gz: 284c940646692e1873590a4c549fd15b96632293ca103f3d4749cc46abc37aba
3
+ metadata.gz: 57f4c9412c284c24c940387465f040e9d7a7e0224792b22201718c1fa111c1b2
4
+ data.tar.gz: d8042eb09794f40bb61ae5794480e60af5c6fca59747f7af15fbb1fcbab96362
5
5
  SHA512:
6
- metadata.gz: 20c95818e777b9a708cfdcd1f819c1b1accdf3b877d20e8e1eb063c735083751e7ec10c34bc1f74154566faac287986a9139976b5aaa674d86acd5b59011a080
7
- data.tar.gz: 2a46d0373c0d1641cf62ff67d74fea96a25f2e4b7fe3008e5332e8dc92d4e18ac7d4bc4aa194e69abfecfc439e13aa71947026b1d0f0a31dd65ed75328b05dd4
6
+ metadata.gz: 875e0536a836e75b3bc6d2193916aa9fc3461cd5bc6923921ef32eaa62f3104b4016a57e965d7f43edbed9ea8d1e0743935d6526f57cfb82f7f9fd96e09548af
7
+ data.tar.gz: 67af59b3be90316d4acdd7c4cb1873acb307bbfb98c857eeabcb72a2d9c23a5648dbea7f522962832cddb5b51ddc2ed3a50e809cb4805ce9718930f2341fafe4
@@ -5,8 +5,21 @@ module GettextI18nRails
5
5
  cattr_accessor :translate_defaults
6
6
  attr_accessor :backend
7
7
 
8
+ # rails-i18n includes Pluralization into this wrapper, but lookups run here.
9
+ class SimpleBackend < I18n::Backend::Simple
10
+ include I18n::Backend::Pluralization
11
+
12
+ protected
13
+
14
+ # default: nil, so a locale without a rule is not a missing translation.
15
+ def pluralizer(locale)
16
+ pluralizers[locale] ||= I18n.t(:"i18n.plural.rule", locale: locale, resolve: false, default: nil)
17
+ end
18
+ end
19
+ private_constant :SimpleBackend
20
+
8
21
  def initialize(*args)
9
- self.backend = I18n::Backend::Simple.new(*args)
22
+ self.backend = SimpleBackend.new(*args)
10
23
  end
11
24
 
12
25
  def available_locales
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRails
2
- Version = VERSION = '2.2.0'
2
+ Version = VERSION = '2.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext_i18n_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser