I believe that the framework for internationalizing C # is very absent, so I usually make one assembly for resources and a link from other projects. The resource files that I generate from some tool (DB, excel, textfile) keep both the source data and the resource files under version control.
MyApp.sln ResourceProject.csproj Resources.resx Resources.ru.resx Resources.de.resx Resource.cs Core.csproj UI.csproj
A resource class can load all different assemblies
namespace MyApp.Resources { public static class Resource { private static ResourceManager manager; static Resource() { manager = new ResourceManager("MyApp.Resources", Assembly.GetAssembly(typeof(Resource))); } public static string GetString(string key, string culture) { return GetString(key, new CultureInfo(culture)); } public static string GetString(string key, CultureInfo culture) { return manager.GetString(key, culture); } } }
This simple class can be extended in various ways. In calling assemblies, you can have utility classes that call based on the current UI culture or thread culture, depending on the situation.
Note that this completely bypasses any of the built-in WinForms or WPF i18N methods.
For the GUI: you can make a utility that recursively translates whole forms. The search itself can / should be expanded with warnings about missing keys, fallback arguments, prefixes / namespaces if you have thousands of keys, etc.
source share