curtisy1 / Intl.Net

A ResX Globalization alternative using JSON instead of bulky XML
MIT License
3 stars 0 forks source link

Allow integration with i18n providers #16

Open curtisy1 opened 1 year ago

curtisy1 commented 1 year ago

We should be able to fetch JSON translations from i18n providers as long as they support exporting. Ideally, this should be a plugin system where each provider is a standalone Nuget package that can be easily integrated. The minimum supported features would be something along the lines of

For reference, here is a non-exhaustive list of providers

They're all up for grabs, since maintaining all of these is too tedious. So when you need them, please contribute!

curtisy1 commented 1 year ago

Since I integrated Tolgee as a PoC for #17, I'll tackle it and see how I can turn it into a plugin

curtisy1 commented 1 year ago

Unfortunately, integrating this via separate NuGet packages is not as easy as I thought for the following reasons: As described in the source generator docs, source generators run unordered this has a few caveats, especially the following:

As such, the main repository now contains a plugins folder that has all existing plugins inside. When implementing, you can simply inherit from the abstract base class and override the Fetch method to return your desired files. For details, see #18 for an implementation