i18n 1.8.5 → 1.8.6
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/i18n.rb +4 -4
- data/lib/i18n/backend/fallbacks.rb +2 -4
- data/lib/i18n/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9b8df30b8d8d663013890240fddf75eda1bd6c117b160ce5bfd319fc6a0e573
|
4
|
+
data.tar.gz: 1dbf4d1a8318f5000647f0d11a0ac8d779221e47668a0bc2717f39979b47c127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f2bf69569a1cf19f77905a58aff61bc764229adf57b3f539a6d59e7006a5b9299de3db48360ae09b33817512096af052925569480cc387494058c635451d97
|
7
|
+
data.tar.gz: 9e8df6cd121e09dfcfdb2384542bbfa4837b7ddb5442d0d5f7ee14832e1b0b7fab0ba65192b733c490b8b25dfd1cfc0bc7e0c87ec57e1b47327caeec067337ad
|
data/lib/i18n.rb
CHANGED
@@ -192,7 +192,7 @@ module I18n
|
|
192
192
|
# I18n.t(:salutation, { :gender => 'w', :name => 'Smith' })
|
193
193
|
# I18n.t(:salutation, any_hash)
|
194
194
|
#
|
195
|
-
def translate(key = nil,
|
195
|
+
def translate(key = nil, throw: false, raise: false, locale: nil, **options) # TODO deprecate :raise
|
196
196
|
locale ||= config.locale
|
197
197
|
raise Disabled.new('t') if locale == false
|
198
198
|
enforce_available_locales!(locale)
|
@@ -217,8 +217,8 @@ module I18n
|
|
217
217
|
|
218
218
|
# Wrapper for <tt>translate</tt> that adds <tt>:raise => true</tt>. With
|
219
219
|
# this option, if no translation is found, it will raise <tt>I18n::MissingTranslationData</tt>
|
220
|
-
def translate!(key, options
|
221
|
-
translate(key, **options
|
220
|
+
def translate!(key, **options)
|
221
|
+
translate(key, **options, raise: true)
|
222
222
|
end
|
223
223
|
alias :t! :translate!
|
224
224
|
|
@@ -281,7 +281,7 @@ module I18n
|
|
281
281
|
# I18n.transliterate("Jürgen") # => "Juergen"
|
282
282
|
# I18n.transliterate("Jürgen", :locale => :en) # => "Jurgen"
|
283
283
|
# I18n.transliterate("Jürgen", :locale => :de) # => "Juergen"
|
284
|
-
def transliterate(key,
|
284
|
+
def transliterate(key, throw: false, raise: false, locale: nil, replacement: nil, **options)
|
285
285
|
locale ||= config.locale
|
286
286
|
raise Disabled.new('transliterate') if locale == false
|
287
287
|
enforce_available_locales!(locale)
|
@@ -10,17 +10,15 @@
|
|
10
10
|
#
|
11
11
|
# I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
|
12
12
|
module I18n
|
13
|
-
@@fallbacks = nil
|
14
|
-
|
15
13
|
class << self
|
16
14
|
# Returns the current fallbacks implementation. Defaults to +I18n::Locale::Fallbacks+.
|
17
15
|
def fallbacks
|
18
|
-
|
16
|
+
Thread.current[:i18n_fallbacks] ||= I18n::Locale::Fallbacks.new
|
19
17
|
end
|
20
18
|
|
21
19
|
# Sets the current fallbacks implementation. Use this to set a different fallbacks implementation.
|
22
20
|
def fallbacks=(fallbacks)
|
23
|
-
|
21
|
+
Thread.current[:i18n_fallbacks] = fallbacks.is_a?(Array) ? I18n::Locale::Fallbacks.new(fallbacks) : fallbacks
|
24
22
|
end
|
25
23
|
end
|
26
24
|
|
data/lib/i18n/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2021-01-01 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: concurrent-ruby
|
@@ -86,10 +86,10 @@ homepage: https://github.com/ruby-i18n/i18n
|
|
86
86
|
licenses:
|
87
87
|
- MIT
|
88
88
|
metadata:
|
89
|
-
bug_tracker_uri: https://github.com/
|
90
|
-
changelog_uri: https://github.com/
|
89
|
+
bug_tracker_uri: https://github.com/ruby-i18n/i18n/issues
|
90
|
+
changelog_uri: https://github.com/ruby-i18n/i18n/releases
|
91
91
|
documentation_uri: https://guides.rubyonrails.org/i18n.html
|
92
|
-
source_code_uri: https://github.com/
|
92
|
+
source_code_uri: https://github.com/ruby-i18n/i18n
|
93
93
|
post_install_message: |2+
|
94
94
|
|
95
95
|
HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: 1.3.5
|
123
123
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
124
|
+
rubygems_version: 3.2.3
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: New wave Internationalization support for Ruby
|