|
1 | 1 | # Changelog
|
2 | 2 |
|
3 |
| -## fluent-react 0.6.0 (Unreleased) |
| 3 | +## fluent-react 0.6.0 (February 1, 2018) |
4 | 4 |
|
5 | 5 | - Allow limited markup in translations. (#101)
|
6 | 6 |
|
|
50 | 50 | the element passed as a prop is cloned with the translated text content
|
51 | 51 | taken from the `DocumentFragment` used as `children`.
|
52 | 52 |
|
53 |
| - - Filter props set by translations with <Localized attrs={{…}}>. |
| 53 | + - Filter props with <Localized attrs={{…}}>. (#139, #141) |
54 | 54 |
|
55 | 55 | The `<Localized>` component now requires the `attrs` prop to set any
|
56 | 56 | localized attributes as props on the wrapped component. `attrs` should be
|
|
74 | 74 |
|
75 | 75 | #### Migrating from `fluent-react` 0.4.1 to 0.6.0
|
76 | 76 |
|
| 77 | +##### Add attrs to Localized. |
| 78 | +
|
77 | 79 | If you're setting localized attributes as props of elements wrapped in
|
78 | 80 | `<Localized>`, in `fluent-react` 0.6.0 you'll need to also explicitly allow
|
79 | 81 | the props you're interested in using the `attrs` prop. This protects your
|
@@ -104,6 +106,8 @@ translations overwriting important props which shouldn't change.
|
104 | 106 | </Localized>
|
105 | 107 | ```
|
106 | 108 |
|
| 109 | +##### Don't pass elements as $arguments. |
| 110 | + |
107 | 111 | In `fluent-react` 0.4.1 it was possible to pass React elements as _external
|
108 | 112 | arguments_ to localization via the `$`-prefixed props, just like you'd pass
|
109 | 113 | a number or a date. This was a bad localization practice because it
|
@@ -184,6 +188,18 @@ send-comment = <confirm>Send</confirm> or <cancel>go back</cancel>.
|
184 | 188 | </Localized>
|
185 | 189 | ```
|
186 | 190 |
|
| 191 | +##### Use fluent 0.6.0+. |
| 192 | + |
| 193 | +`fluent-react` 0.6.0 works best with `fluent` 0.6.0. It might still work with |
| 194 | +`fluent` 0.4.x but passing elements as `$`-prefixed arguments to translations |
| 195 | +will break your app. You might also run into other issues with translations |
| 196 | +with attributes and no values. Upgrading your code to [`fluent` 0.6.0][] and |
| 197 | +your localization files to [Fluent Syntax 0.5][] is the best way to avoid |
| 198 | +troubles. |
| 199 | + |
| 200 | +[`fluent` 0.6.0]: https://github.com/projectfluent/fluent.js/releases/tag/fluent%400.6.0 |
| 201 | +[Fluent Syntax 0.5]: https://github.com/projectfluent/fluent/releases/tag/v0.5.0 |
| 202 | + |
187 | 203 | ## fluent-react 0.4.1 (June 30, 2017)
|
188 | 204 |
|
189 | 205 | - Relax the constraint on Localized only being valid as descendants of
|
|
0 commit comments