liqula / react-hs

A GHCJS binding to React based on the Flux design. The flux design pushes state and complicated logic out of the view, allowing the rendering functions and event handlers to be pure Haskell functions.
32 stars 10 forks source link

Support for i18n? #5

Open fisx opened 7 years ago

fisx commented 7 years ago

Keeping track of the language selected by the user is either awkward (make all functions everywhere take an extra argument) or unelegant (use a global MVar, which requires unsafePerformIO).

A better design may be possible if we have a class constraint HasI18nKey that can be required by all places that currently require ReactElementM, and possibly others (e.g. when generating form errors or printing errors from the backend).

This issue needs more details.

fisx commented 7 years ago

Note that there is Intl, which wraps a react library, but (a) it has several problems and I would like to replace it with something nicer, and (b) this issue is more about preparing the library core to support the kind of effects that handling multiple languages requires.