drilkmops – 15-59 Aug 19
This is gonna be a really dumb question I should know the answer to.
I’m building a localization library. I have a big list of locale data that I only need to load a portion of each time. I dont want my end users to need any additional setup.
Is there a way for a static website to like “lazy load” the extra locale data when they’re needed only? So when someone visits the static page they only get
en
, but if something for fr
is used, it “fetches” that data somehow? I’d like to not require additional fetches to other endpoints, but CDN is likely fine I suppose.26 Replies
Unknown User•5w ago
Message Not Public
Sign In & Join Server To View
Ours is a bit more abstract since I’m writing some Rust that convert into wasm and typescript methods to call the wasm.
Unknown User•5w ago
Message Not Public
Sign In & Join Server To View
More context, I work at a big company and we can be a bit opinionated.
We’re wrapping icu4x
https://github.com/unicode-org/icu4x
GitHub
GitHub - unicode-org/icu4x: Solving i18n for client-side and resour...
Solving i18n for client-side and resource-constrained environments. - unicode-org/icu4x
Unknown User•5w ago
Message Not Public
Sign In & Join Server To View
Tbf it does make sense if we step back haha. We want a single localization solution across all our stacks. We can compile this into whatever language.
Unknown User•5w ago
Message Not Public
Sign In & Join Server To View
That’s good feedback regardless tbh.
Unknown User•5w ago
Message Not Public
Sign In & Join Server To View
Where would the assets be loaded from? Like would vite be packaging all of that and load it dynamically? Or would I do a cdn route? Cuz we got like 1.5mb and growing of locale data. I know we can reduce it, but trying to think of cleaner ways now.
Previously it required an external cal to convert their data. And they don’t want that.
Unknown User•5w ago
Message Not Public
Sign In & Join Server To View
I’m sure we have a way to do a CDN just fine at work to. Honestly that might be the move. Just fetch the locale blob we need from a cdn and bundle whatever data they need
Unknown User•5w ago
Message Not Public
Sign In & Join Server To View
CDN will be fast af anyway