drilkmops
drilkmops2mo ago

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
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
drilkmops
drilkmops2mo ago
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
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
drilkmops
drilkmops2mo ago
More context, I work at a big company and we can be a bit opinionated.
drilkmops
drilkmops2mo ago
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
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
drilkmops
drilkmops2mo ago
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
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
drilkmops
drilkmops2mo ago
That’s good feedback regardless tbh.
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
drilkmops
drilkmops2mo ago
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
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
drilkmops
drilkmops2mo ago
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
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
drilkmops
drilkmops2mo ago
CDN will be fast af anyway