ghorsington / COM3D2.i18nEx

Internationalization plug-in for COM3D2 for speed and simplicity
MIT License
28 stars 5 forks source link

https://github.com/customordermaid3d2/COM3D2.i18nEx #10

Open lilly1987 opened 2 years ago

lilly1987 commented 2 years ago

zip support

ghorsington commented 2 years ago

Greetings!

Thank you for the PR. Before I began reviewing it, I noticed one important design choice that I'd like to ask about.

i18nEx allows swapping Core.TranslationLoader which handles loading the actual translations. The loader is BasicTranslationLoader, which reads translations directly from a file by default. You can change the loader to your own by editing the i18nEx configuration file ([Info].Loader option, see Core.GetLoader for how it works). With that option, you can easily create a ZIP loader and tell i18nEx to use it with a configuration option.

I made translation loaders modular for cases where you want to download translations from another file type (e.g. encrypted ZIPs). Your proposed solution edits BasicTranslationLoader directly, but in my opinion, that isn't necessary. Instead, I suggest two options:

What is your opinion on this? Any reason why you specifically want your ZIP logic to be part of BasicTranslationLoader?

lilly1987 commented 2 years ago

I wish there was a separate dll example. There is no reason why the ZIP logic should be part of the BasicTranslationLoader.