projectfluent / fluent.js

JavaScript implementation of Project Fluent
https://projectfluent.org/
Apache License 2.0
936 stars 77 forks source link

Control localizable attributes on elements passed as props #185

Open stasm opened 6 years ago

stasm commented 6 years ago

We should make it possible for developers to control which attributes can be translated on elements passed as props to <Localized>.

stasm commented 6 years ago

The solution might be similar to the one proposed in #184. By wrapping the prop element in an id-less <Localized> developers would be able to use attrs:

<Localized id="hello"
    clickablePortrait={
        <Localized attrs={{title: true}}>
            <Portrait.../>
        </Localized>
    }
>
    <p>{"Hello, <clickablePortrait></clickablePortrait>!"}</p>
</Localized>