intl and glob

master
Simon Rozsival 8 years ago
parent a0c8147485
commit 768ed4050c

@ -1784,6 +1784,17 @@ We decided to use React and Redux over Angular 2 for several reasons:
- It is easy to debug React component tree and Redux state transitions
using extensions for Google Chrome and Firefox.
##### Internationalization And Globalization
The user interface must be accessible in multiple languages and should be easily
translatable into more languages in the future. The most promissing library
which enables react applications to translate all of the messages of the UI is
[react-intl](https://github.com/yahoo/react-intl).
A good JavaScript library for manipulation with dates and times is
[Moment.js](http://momentjs.com). It is used by many open-source react
components like date and time pickers.
#### User Interface Design
There is no artist on the team so we had to come up with an idea how to create a
@ -3497,7 +3508,6 @@ decide which actions it will process and which it will ignore based on the
*type* of the action. The simple reducers can change only a specific subtree of
the whole state tree and these subtrees do not overlap.
##### Redux Middleware
A middleware in redux is a function which can process actions before they are
@ -3640,6 +3650,24 @@ property `loadAsync` which should contain a function returning a *Promise*. The
SRR calls all these functions and delays the response of the HTTP server until
all of the promises are resolved (or some of them fails).
### Localization and globalization
The whole application is prepared for localization and globalization. All of the
translatable texts can be extracted from the user interface and translated
into several languages. The numbers, dates, and time values are also formatted
with respect to the selected language. The
[react-intl](https://github.com/yahoo/react-intl) and
[Moment.js](http://momentjs.com/) libraries are used to achieve this.
All the strings can be extracted from the application using a command:
```
$ npm run exportStrings
```
This will create JSON files with the exported strings for the 'en' and 'cs'
locale. If you want to export strings for more languages, you must edit the
`/manageTranslations.js` script. The exported strings are placed in the
`/src/locales` directory.
## Communication Protocol

Loading…
Cancel
Save