What options do i have, if i want to localize WPF applications. I would like to have option to fill .resx files for languages, and that works. But I need to get language during runtime from files.
So my question is: Is it possible to get external .resx in WPF apps. And change language during runtime? Or am I looking at this issue at bad angle?
Why not just compile your resx files along with your default resources?
Set
Thread.CurrentThread.CurrentUICultureto your desired culture, then call ResourceManager.GetString() to set your localized properties.If you wanted to get another culture, use the overload. Something like:
To add a resource dynamically, use the appropriate ResourceManager constructor, which allows you to specify the resource and the assembly it is contained within.