File tree Expand file tree Collapse file tree 6 files changed +966
-1
lines changed Expand file tree Collapse file tree 6 files changed +966
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ gem "autoprefixer-rails"
51
51
52
52
gem "awesome_print"
53
53
54
+ gem "i18n-js" , ">= 3.0.0.rc11"
55
+
54
56
# jquery as the JavaScript library has been moved under /client and managed by npm.
55
57
# It is critical to not include any of the jquery gems when following this pattern or
56
58
# else you might have multiple jQuery versions.
Original file line number Diff line number Diff line change 109
109
globalid (0.3.7 )
110
110
activesupport (>= 4.1.0 )
111
111
i18n (0.7.0 )
112
+ i18n-js (3.0.0.rc14 )
113
+ i18n (~> 0.6 , >= 0.6.6 )
112
114
interception (0.5 )
113
115
io-like (0.3.0 )
114
116
jbuilder (2.6.0 )
@@ -319,6 +321,7 @@ DEPENDENCIES
319
321
factory_girl_rails
320
322
foreman
321
323
generator_spec
324
+ i18n-js (>= 3.0.0.rc11 )
322
325
jbuilder
323
326
launchy
324
327
listen
Original file line number Diff line number Diff line change @@ -11,5 +11,8 @@ class Application < Rails::Application
11
11
# Settings in config/environments/* take precedence over those specified here.
12
12
# Application configuration should go into files in config/initializers
13
13
# -- all .rb files in that directory are automatically loaded.
14
+
15
+ # i18n-js
16
+ config . middleware . use I18n ::JS ::Middleware
14
17
end
15
18
end
Original file line number Diff line number Diff line change 16
16
"application_#{ type } .js" ,
17
17
"application_#{ type } .css"
18
18
]
19
+
20
+ Rails . application . config . assets . precompile += %w( i18n.js )
Original file line number Diff line number Diff line change
1
+ module RenderingExtension
2
+ def self . custom_context ( _view_context )
3
+ { translations : I18n . backend . send ( :translations ) }
4
+ end
5
+ end
1
6
# Shown below are the defaults for configuration
2
7
ReactOnRails . configure do |config |
3
8
# Directory where your generated assets go. All generated assets must go to the same directory.
74
79
75
80
# This allows you to add additional values to the Rails Context. Implement one static method
76
81
# called `custom_context(view_context)` and return a Hash.
77
- config . rendering_extension = nil
82
+ config . rendering_extension = RenderingExtension
78
83
79
84
# The server render method - either ExecJS or NodeJS
80
85
config . server_render_method = "ExecJS"
You can’t perform that action at this time.
0 commit comments