3 ms·
I haven't tried Fluent yet, but—in theory—could you not have both the message identifier and the original string in your code? Their React example kind of poin
by doesntmeananyth 3y ago
I haven't tried Fluent yet, but—in theory—could you not have both the message identifier and the original string in your code?
Their React example kind of points towards this: https://github.com/projectfluent/fluent.js/wiki/React-Bindings#wrapped-components https://github.com/projectfluent/fluent.js/wiki/React-Bindin...
They provide a <Localized> component, which has an identifier and wraps a piece of markup containing the original:
<Localized id="hello">
<h1>Hello, world!</h1>
</Localized>
Seems like the best of both worlds.
- iudqnolq 3y agoPer the docs the wrapped markup is to improve readability for devs, it isn't ever used. That seems like the worst of both worlds to me.