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 +4 -4
- data/lib/gettext_i18n_rails/backend.rb +14 -1
- data/lib/gettext_i18n_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57f4c9412c284c24c940387465f040e9d7a7e0224792b22201718c1fa111c1b2
|
|
4
|
+
data.tar.gz: d8042eb09794f40bb61ae5794480e60af5c6fca59747f7af15fbb1fcbab96362
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 =
|
|
22
|
+
self.backend = SimpleBackend.new(*args)
|
|
10
23
|
end
|
|
11
24
|
|
|
12
25
|
def available_locales
|