Skip to content

Commit 1132e9d

Browse files
committed
update docs
1 parent b0a10f2 commit 1132e9d

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]
66
## [Unreleased]
77
*Please add entries here for your pull requests.*
88

9+
### Added
10+
- Allow using rake task to generate javascript locale files. [#717](https://github.com/shakacode/react_on_rails/pull/717) by [JasonYCHuang](https://github.com/JasonYCHuang).
11+
912
## [6.6.0] - 2017-02-18
1013
### Added
1114
- Switched to yarn! [#715](https://github.com/shakacode/react_on_rails/pull/715) by [squadette](https://github.com/squadette).

docs/basics/i18n.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Here's a summary of adding the I18n functionality.
44

55
You can refer to [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial) and [PR #340](https://github.com/shakacode/react-webpack-rails-tutorial/pull/340) for a complete example.
66

7-
1. Add `react-intl` & `intl` to `client/package.json`, and remember to `bundle && npm install`.
7+
1. Add `react-intl` & `intl` to `client/package.json`, and remember to `bundle && yarn install`.
88

99
```js
1010
"dependencies": {
@@ -44,18 +44,11 @@ You can refer to [react-webpack-rails-tutorial](https://github.com/shakacode/rea
4444
config.i18n_dir = Rails.root.join("PATH_TO", "YOUR_JS_I18N_FOLDER")
4545
```
4646
47-
Add following lines to `config/application.rb`, this will help you to generate `translations.js` & `default.js` automatically when you starts the server.
47+
4. Javascript locale files must be generated before `yarn build`.
48+
49+
Once you setup `config.i18n_dir` as in the previous step, react_on_rails will help you to do this.
4850
49-
```js
50-
module YourModule
51-
class Application < Rails::Application
52-
...
53-
config.after_initialize do
54-
ReactOnRails::LocalesToJs.new
55-
end
56-
end
57-
end
58-
```
51+
If you create your own Procfile files, you must add `bundle exec rake react_on_rails:locale` before `yarn build`.
5952
6053
5. In React, you need to initialize `react-intl`, and set parameters for it.
6154

0 commit comments

Comments
 (0)