Skip to content

Commit

Permalink
Englisgh review. Thanks to @tobiasmuehl and @tomByrer
Browse files Browse the repository at this point in the history
  • Loading branch information
langpavel committed Apr 27, 2016
1 parent 943a9e2 commit 0eb6b28
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ forked repo, check that it meets these guidelines:
* [Squash](http://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git)
your commits into one for each PR.
* Run `npm test` to make sure that your code style is OK and there are no any regression bugs.
* If you contributing to opt-in feature, prefix your PR title with `[feature/...]` tag.
* When contributing to an opt-in feature, apply the `[feature/...]` tag as a prefix to your PR title

#### Style Guide

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ expenses via [OpenCollective](https://opencollective.com/react-starter-kit) or

### Feature branches

There are feature branches.
You can just merge and it will give you desired functionality.
These branches should be in sync with master and themselves so there should not be merging conflicts. If not, please report it.
Some features aren't provided by default, but you can optionally add them.
To do so, simply merge the corresponding feature branch.
These branches should be in sync with master and all other features branches
so there should not be any merging conflicts.
If conflicts occure, please open an issue and report to us.

* [feature/redux](https://github.com/kriasoft/react-starter-kit/tree/feature/redux) – isomorphic redux support.
Use [`connect()`](https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options)
Expand Down
16 changes: 8 additions & 8 deletions docs/recipes/feature-react-intl.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## Integrating [React-Intl](https://github.com/yahoo/react-intl#react-intl)

1. Merge `feature/react-intl` branch with git.
You will get `feature/redux` too because this is based on top of it.
Because react-intl integration is built on top of `feature/redux`, you'll also get all the features.

2. Adjust `INTL_REQUIRE_DESCRIPTIONS` constant in `tools/webpack.config.js` around line 17:
```js
const INTL_REQUIRE_DESCRIPTIONS = true;
```
It's boolean. When enabled, build will fail if `description` is not provided.
When this boolean is set to true, the build will only succeed if a `description` is set for every message descriptor.

3. Adjust `locales` settings in `src/config.js`:
```js
Expand Down Expand Up @@ -38,12 +38,12 @@

## How to write localizable components

Just import appropriate [component](https://github.com/yahoo/react-intl/wiki#the-react-intl-module) from `react-intl`
Just import the appropriate [component](https://github.com/yahoo/react-intl/wiki#the-react-intl-module) from `react-intl`

- For localizable text use
[`<FormattedMessage>`](https://github.com/yahoo/react-intl/wiki/Components#formattedmessage).
- You can also use it with
[`defineMessages()`](https://github.com/yahoo/react-intl/wiki/API#definemessages) helper.
the [`defineMessages()`](https://github.com/yahoo/react-intl/wiki/API#definemessages) helper.

- For date and time:
[`<FormattedDate>`](https://github.com/yahoo/react-intl/wiki/Components#formatteddate)
Expand All @@ -57,7 +57,7 @@ Just import appropriate [component](https://github.com/yahoo/react-intl/wiki#the
- Do not use `<FormattedHTMLMessage>` if possible, see how to use *Rich Text Formatting* with
[`<FormattedMessage>`](https://github.com/yahoo/react-intl/wiki/Components#formattedmessage)

- When you need imperative formatting API, use [`injectIntl`](https://github.com/yahoo/react-intl/wiki/API#injectintl) High-Order Component.
- When you need an imperative formatting API, use the [`injectIntl`](https://github.com/yahoo/react-intl/wiki/API#injectintl) High-Order Component.

### Example

Expand Down Expand Up @@ -106,15 +106,15 @@ export default injectIntl(Example);

## Updating translations

When developing, every source file is watched and parsed for messages on change.
When running the development server, every source file is watched and parsed for changed messages.

Messages files are updated on the fly.
If new definition is found, this definition is added at the end of every used `src/messages/xx-XX.json` file so when commiting, new translations are at the tail of file.
When untranslated message is removed and if it's `message` field is empty too, message is deleted from all translation files. This is reason why `files` array is present.
When developing and you edit translation file, it should be copied to `build/messages/` directory.
When editiong a translation file, it should be copied to `build/messages/` directory.
## Other references
## Other References
* [`Intl documentation on MDN`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl)
* [express-request-language](https://github.com/tinganho/express-request-language#readme)
Expand Down
12 changes: 5 additions & 7 deletions docs/recipes/feature-redux.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Merge `feature/redux` branch with git.
If you are interrested into `feature/react-intl`,
merge that branch instead.
It contains this implementation of redux
merge that branch instead as it also includes Redux.

**If you don't know redux well, you should [read about it first](http://redux.js.org/docs/basics/index.html).**

Expand All @@ -15,12 +14,11 @@ It contains this implementation of redux
2. Go to `src/actions/` and create file with appropriate name.
You can copy `src/actions/runtime.js` as a template.

3. If you need async action, [`redux-thunk`](https://github.com/gaearon/redux-thunk#readme)
is there for you.
3. If you need async actions, use [`redux-thunk`](https://github.com/gaearon/redux-thunk#readme).
For inspiration how to create async actions you can look at
[`setLocale`](https://github.com/kriasoft/react-starter-kit/blob/feature/react-intl/src/actions/intl.js)
action from `feature/react-intl`.
See [Async Flow](http://redux.js.org/docs/advanced/AsyncFlow.html) for more on this topic
See [Async Flow](http://redux.js.org/docs/advanced/AsyncFlow.html) for more information on this topic.


## Creating Reducer (aka Store)
Expand All @@ -36,7 +34,7 @@ It contains this implementation of redux
You can use this construct: `{ ...state, updatedKey: action.payload.value, }`
- Keep in mind that store state *must* be repeatable by replaying actions on it.
For example, when you store timestamp, pass it into *action payload*.
If you call REST API, do it in action. Never do this things in reducer!
If you call REST API, do it in action. *Never do this in reducer!*

2. Edit [`src/reducers/index.js`](https://github.com/kriasoft/react-starter-kit/tree/feature/redux/src/reducers/index.js), import your reducer and add it to root reducer created by
[`combineReducers`](http://redux.js.org/docs/api/combineReducers.html)
Expand All @@ -50,7 +48,7 @@ See [Usage With React](http://redux.js.org/docs/basics/UsageWithReact.html) on r

For example you can look at
[`<LanguageSwitcher>`](https://github.com/kriasoft/react-starter-kit/blob/feature/react-intl/src/components/LanguageSwitcher/LanguageSwitcher.js)
component from `feature/react-intl` branch. It demonstrates both, subscribing to store and dispathing actions.
component from `feature/react-intl` branch. It demonstrates both, subscribing to store and dispatching actions.


## Dispatching Actions On Server
Expand Down

0 comments on commit 0eb6b28

Please sign in to comment.