Skip to content

Commit cd30ccb

Browse files
committed
Update to React 18+
1 parent c60995c commit cd30ccb

13 files changed

+36594
-10644
lines changed

README.md

+39-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,47 @@
11
## Demo
2-
[Checkout working demo with 3 languages](https://react-intl.simplelocalize.io)
2+
[Live demo](https://react-intl.simplelocalize.io)
33

4-
## Available Scripts
4+
## Overview
5+
6+
Sample application with 3 languages. The application is built with React 18, react-intl. It uses React Context to keep translation messages
7+
and FormattedMessage components with **predefined message IDs.**
8+
9+
```tsx
10+
<FormattedMessage id="USE_BUTTONS_BELOW" />
11+
```
12+
13+
To **use auto-generated message IDs**, please [eject the app](https://create-react-app.dev/docs/available-scripts/#npm-run-eject)
14+
and follow the [Bundling with FormatJS](https://formatjs.io/docs/guides/bundler-plugins/) instructions.
15+
16+
## Built with
17+
- Create React App
18+
- React 18+
19+
- TypeScript 4+
20+
- React Hooks
21+
- React Context
22+
- React Intl - library for internationalization
23+
- SimpleLocalize - translation management system
24+
25+
## Extracting translations
26+
27+
In the project directory, you can run:
28+
### `npm run i18n:extract`
29+
to extract messages from source code to `lang/en.json` file.
30+
31+
### `npm run i18n:upload`
32+
to upload messages to the SimpleLocalize service.
33+
34+
### `npm run i18n:download`
35+
to download messages locally from the SimpleLocalize service. This is optional and it requires to change SimpleLocalize.tsx
36+
to load translations from local files.
37+
38+
> Please provide a valid API Key in `simplelocalize.yml` configuration file.
39+
40+
## Running application locally
541

642
In the project directory, you can run:
743

8-
### `yarn start`
44+
### `npm install && npm start`
945

1046
Runs the app in the development mode.<br />
1147
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

0 commit comments

Comments
 (0)