feat: load remote catalogs with remoteLoader()#1080
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/lingui-js/js-lingui/HcpZSkoxQjFqNvaAW14p3DqpMLNe |
size-limit report 📦
|
087846c to
775c85a
Compare
|
Hey @semoal, sorry for reaching out, considering it's already been 4 years since you introduced this feature. Is there a reason why it didn't end up in the documentation? Should we not use it or? |
|
@jsefiani there is a better way to achieve the same functionality. This loader is abandoned and not published since Lingui@3 If you want to just load catalogs from the server, you can put them on CDN already pre-compiled. If you want to compile catalogs on the fly, you can use lambda / cloud functions and use You also can compile catalogs using You also can also use Crowdin, they have a plugin for lingui which will provide OTA delivery for messages with proper compilation. |
This new feature opens a whole world for loading the messages:
Now you could perfectly store your
.json,.po, or even.csvfiles of Lingui in remote environments like an AWS S3, and recover them dynamically.Basically now you could so something similar to this:
How does this handle fallbacks?
You can perfectly pass a fallback messages object, it can be a .json file or even a .po file.
There's pending to write documentation of this, I'll push the documentation along the week since I'm not sure if this will 100% work great