You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The i18n new API for Hilla doesn't unfortunately work without Hilla being used (imported packages, generator and so on). This explains your workaround.
We need to generate the translation API even without Hilla to make this work.
This is similar to #20289 (comment), i.e. a bundle can be used and partial Hilla installation. The complexity is how Flow can detect the usage of the Hilla's i18n API in the project.
The react-i18n module is a Hilla feature. It might indeed also be useful in other contexts such as ReactAdapterElement but that's not what it's designed for. The workaround of adding a dummy Hilla view does thus seem reasonable even though it would of course be convenient if it wouldn't be needed.
Description of the bug
translate('demo.react.hello') does not work in ReactAdapterElement. Found the magic trick to add a dummy view in the frontend/views folder.
BTW: Frontend translation works very good now, with hotswap too.
Expected behavior
Work without the magic trick that activates Hilla
Minimal reproducible example
{translate('demo.react.hello')}
Versions
24.5.1
The text was updated successfully, but these errors were encountered: