Re:HTML Web Components
by littlecranky67 on Tuesday November 14, 2023 @02:19AM
(#38260099)
Maybe it is just me but for me web-components were never able to deliver what they promised or a viable solution for a simple reason: i18n/translations. As a European freelance web dev, I've virtually never been in a project where we develop single-language UIs - its always at least the national language plus English.
Those translations can't reside within a "component" itself for a simple reason: Translators push you to always share translations across components to achieve consistency throughout your UI. Now with react-intl or react-i18n-next those translation strings will live in a single or just a couple of files for the whole UI, and be provided through a react Context.
It is also one of my pet peeves when people talk about "independent, self-sustained components". That is just not a thing in UI land, in most bigger projects each component has quite some external dependency from some form of enclosing context (translations beeing the most common one).
In the article, user-avatar is probable one without any text at all, but thats the minority of components.
[ Parent
| on HN ]
@lit/localize (https://lit.dev/docs/localization/overview/) give you the same DX of react-intl, but for (lit-powered) web components
Re:HTML Web Components
by floriankiem on Tuesday November 14, 2023 @10:46AM
(#38264697)
I'm from inlang and we're building an ecosystem around globalization.
Recently, we have released paraglideJS – a typesafe, super lightweight library that works with every framework. We've received a lot of good feedback in the last couple of days, feel free to try if it satisfies your purpose: https://inlang.com/m/gerre34r/library-inlang-paraglideJs