gettext_i18n_rails 1.8.0 → 1.8.1
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 +5 -5
- data/lib/gettext_i18n_rails/action_controller.rb +18 -7
- data/lib/gettext_i18n_rails/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 03205ca066f3c898e4da0ec0a8262e4fd0127498b5c975c0b5b2935062d146f5
|
4
|
+
data.tar.gz: c1d50f46d8a6e4805d3ddec69c4a1965fdafdc5b06ecea0534c2cb1e7cec4b45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 660ee38d092d0538f4ced161e32c0976edbf58c2ce5a4230b32729787103728f18ba6e5435ef185314ff4696762c929c1578c2c240a5ce5ca35fe79d259ba824
|
7
|
+
data.tar.gz: 7fa2d67dbe95ab585c01dd3f8c988f20a23f3d46cfadc99da0b04acd41d87deb5d932a859a7d7dda6f90d137df661c704458d5091db0e2d084a389b39eba47db
|
@@ -1,8 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
# Autoloading in initializers is deprecated on rails 6.0. This delays initialization using the on_load
|
2
|
+
# hooks, but does not change behaviour for existing rails versions.
|
3
|
+
path_controller = ->() {
|
4
|
+
class ::ActionController::Base
|
5
|
+
def set_gettext_locale
|
6
|
+
requested_locale = params[:locale] || session[:locale] || cookies[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'] || I18n.default_locale
|
7
|
+
locale = FastGettext.set_locale(requested_locale)
|
8
|
+
session[:locale] = locale
|
9
|
+
I18n.locale = locale # some weird overwriting in action-controller makes this necessary ... see I18nProxy
|
10
|
+
end
|
7
11
|
end
|
8
|
-
|
12
|
+
}
|
13
|
+
if defined?(Rails) && Rails::VERSION::MAJOR >= 6
|
14
|
+
ActiveSupport.on_load(:action_controller_base) do
|
15
|
+
path_controller.call
|
16
|
+
end
|
17
|
+
else
|
18
|
+
path_controller.call
|
19
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gettext_i18n_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fast_gettext
|
@@ -224,8 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
224
|
- !ruby/object:Gem::Version
|
225
225
|
version: '0'
|
226
226
|
requirements: []
|
227
|
-
|
228
|
-
rubygems_version: 2.5.1
|
227
|
+
rubygems_version: 3.0.3
|
229
228
|
signing_key:
|
230
229
|
specification_version: 4
|
231
230
|
summary: Simple FastGettext Rails integration.
|