1
- # fluent- react
1
+ # @ fluent/ react
2
2
3
- ` fluent- react ` provides React bindings for Project Fluent, a localization
3
+ ` @ fluent/ react` provides React bindings for Project Fluent, a localization
4
4
framework designed to unleash the expressive power of the natural language.
5
5
6
6
7
7
## Installation
8
8
9
- ` fluent- react ` can be used both on the client-side and the server-side. You
9
+ ` @ fluent/ react` can be used both on the client-side and the server-side. You
10
10
can install it from the npm registry or use it as a standalone script (as the
11
11
` FluentReact ` global).
12
12
13
- npm install fluent- react
13
+ npm install @ fluent/ react
14
14
15
15
16
16
# Integrating with React apps
17
17
18
- ` fluent- react ` takes advantage of React's Components system and the virtual
19
- DOM. Translations are exposed to components via the _ provider_ pattern.
18
+ ` @ fluent/ react` takes advantage of React's Components system and the virtual
19
+ DOM. Translations are exposed to components via the _ provider_ pattern.
20
20
21
- There are many approaches to fetching and storing translations. To allow
22
- maximum flexibility, ` fluent- react ` expects the developer to write a little bit
23
- of a setup code related to language negotiation and translation fetching. It
24
- makes ` fluent- react ` unopinionated and suitable for many different scenarios.
25
- You will likely also need to install a few other packages: ` fluent ` ,
26
- ` fluent- langneg ` and ` intl-pluralrules ` .
21
+ There are many approaches to fetching and storing translations. To allow
22
+ maximum flexibility, ` @ fluent/ react` expects the developer to write a little
23
+ bit of a setup code related to language negotiation and translation fetching.
24
+ It makes ` @ fluent/ react` unopinionated and suitable for many different
25
+ scenarios. You will likely also need to install a few other packages:
26
+ ` @ fluent/bundle ` , ` @fluent/ langneg` and ` intl-pluralrules ` .
27
27
28
- Consult the [ wiki] [ ] for documentation on how to set up and use ` fluent- react ` .
28
+ Consult the [ wiki] [ ] for documentation on how to set up and use ` @ fluent/ react` .
29
29
30
30
[ wiki ] : https://github.com/projectfluent/fluent.js/wiki/React-Bindings
31
31
@@ -36,14 +36,14 @@ For legacy browsers, the `compat` build has been transpiled using Babel's [env
36
36
preset] [ ] :
37
37
38
38
``` javascript
39
- import ' fluent- react/compat' ;
39
+ import " @ fluent/ react/compat" ;
40
40
```
41
41
42
42
In some cases, using the ` compat ` build may be needed even if you target
43
43
modern browsers. For instance, the [ ` create-react-app ` boilerplate uses
44
44
UglifyJS to minify its files] [ create-react-app-minify ] . As of November 2017,
45
45
UglifyJS doesn't support some of the new JavaScript syntax features. By using
46
- the ` compat ` build of all ` fluent ` packages you can ensure that the
46
+ the ` compat ` build of all ` @ fluent` packages you can ensure that the
47
47
minifiction works properly.
48
48
49
49
0 commit comments