gettext_i18n_rails 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 494dbc18eaabefe310729f46cab58dacbbed797a
4
- data.tar.gz: c7ad9fc663c123b2f91a2dec6b94efa826c18d9c
2
+ SHA256:
3
+ metadata.gz: 03205ca066f3c898e4da0ec0a8262e4fd0127498b5c975c0b5b2935062d146f5
4
+ data.tar.gz: c1d50f46d8a6e4805d3ddec69c4a1965fdafdc5b06ecea0534c2cb1e7cec4b45
5
5
  SHA512:
6
- metadata.gz: fb9b2a7a3c39a1f050f89f5512e850c16af924cd94d5be26801093738a87fe3c59743e71e1bf246671e0de5d0d0d480aa3985238db835e33c6eb96ae4de0f7d4
7
- data.tar.gz: c14407cf69d6c638b6f8966f9afa0efb88e77084801eb3498fd75bd91a2a7498e7f6245a21bd57a44ba7f3110037c80d3e4665a5e768676da14a77e7b47fdc8d
6
+ metadata.gz: 660ee38d092d0538f4ced161e32c0976edbf58c2ce5a4230b32729787103728f18ba6e5435ef185314ff4696762c929c1578c2c240a5ce5ca35fe79d259ba824
7
+ data.tar.gz: 7fa2d67dbe95ab585c01dd3f8c988f20a23f3d46cfadc99da0b04acd41d87deb5d932a859a7d7dda6f90d137df661c704458d5091db0e2d084a389b39eba47db
@@ -1,8 +1,19 @@
1
- class ActionController::Base
2
- def set_gettext_locale
3
- requested_locale = params[:locale] || session[:locale] || cookies[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'] || I18n.default_locale
4
- locale = FastGettext.set_locale(requested_locale)
5
- session[:locale] = locale
6
- I18n.locale = locale # some weird overwriting in action-controller makes this necessary ... see I18nProxy
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
- end
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
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRails
2
- Version = VERSION = '1.8.0'
2
+ Version = VERSION = '1.8.1'
3
3
  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.0
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: 2016-08-11 00:00:00.000000000 Z
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
- rubyforge_project:
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.