I will favour Valdis solution for generalization purposes, https://github.com/valdisiljuconoks/LocalizationProvider
/K
But it feels a bit wrong to include this whole other plugin to EPiServer just to be able to have translated texts in a widget. The idea is to have this package as selfcontained as possible so that when installing this it would not require more than a specific EPiServer version. Adding dependency to a another plugin might constrain the ability to update this package to support versions of EPiServer that the other plugin might not yet have support for (if that will happen)
I would include the xml file as an embedded resource.
If the values has to be modified to site specific values, you could add a new xml-file with the same keys to override the values from the module.
Excellent! The embedded resource solution fits very well. After setup like Marijas answer in this thread (https://world.episerver.com/forum/developer-forum/Episerver-7-CMS/Thread-Container/2013/1/Embedded-language-file-for-Add-on/) it works perfectly. Thanks for the input!
We are developing a a gadget for EPiServer with the aim to publish it through EPiServer nuget feed. When looking into translating texts in the the gadget we started looking into the i18n setup described here http://joelabrahamsson.com/localization-in-widgets-used-as-episerver-gadgets-or-property-editors/
But if we are to pack a xml-file with the translations in the nuget pack can we always put it in the Resources/Languagesfiles? This can be configured i each site differently so how to make sure that the translations are included correctly?
Is there a way to have these files inside the modules/_protected/gadgetfolder instead or how is this kind of things handled in the best way when having it as a nuget package? We tried putting the files in different folders of the module but if the file is not correctly placed the whole edit ui stops working.