Replies: 3 comments
|
@ekosz that great to hear. It's a much better message construction system than standard gettext, or MF1 for that matter. I would very happy to collaborate on how to apply it to markup in a canonical Elixir way. Which means plugging in to the template system I suppose - and it's a long time since I've been down that rabbit hole. I'd welcome any practical ideas on how to take this forward - it would be exciting to get this integrated into the markup world. |
|
I've published localize version 0.8.0 that includes a Localize.Message.format_to_safe_list/3 function that doesn't strip markup from messages. I think that function can be a solid basis for implementing the web layer in whatever manner is appropriate. I'm far from expert on the web layer so input, guidance, ideas are extremely welcome. I think that's all best done in the localize_web library that I'm releasing to hex in the next few hours. I've added to the markup section of the Message Formatting guide to help explain this more. Comments, suggestions, ideas very welcome. |
|
More more thing - I've added a Claude-generated plan at https://github.com/elixir-localize/localize_web/blob/main/guides/mf2-markup-rendering_plan.md for its ideas on how to integrate at the template and rendering layer. Just food for thought. |
Uh oh!
There was an error while loading. Please reload this page.
First off, I'm a huge fan of the
ex_cldr_*libraries and now very excited for localize! To be honest, before this project I didn't even know MessageFormat 2 existed. I've been using MessageFormat since my React days using thereact-intl/FormatJS library. Of of the thingsreact-intlhad thatex_cldr_messagedidn't, was the ability to inject rich text surrounding elements. I had to manually hack together some complicated Elixir macros to enable something similar in my LiveView applications withex_cldr_message.It's awesome to see that's now built into the standard itself. Do you have plans / ideas for how localize may support that syntax as well? I see its implemented at the parser level but not yet at the implementation level. Is this an area you're looking for help with?
All reactions