Simon
Simon

Reputation: 155

Store translations in DLL instead of RESX file in a C# .NET8 Forms application

I'm currently developing a C# .NET8 WinForms application that should be multilanguage as it will be deployed in multiple countries in Europe.

I've installed MAT (Multilanguage App Toolkit) Extension for VS2022 and Multilingual Editor for XLF files, and I've managed to correctly add the required languages and translations inside RESX files.

I've noticed that every translation resource file is embedded in the final EXE. Is it possible to avoid this behavior and use external DLLs to dynamically load languages at runtime?

Basically I would like to have a default language embedded inside the application (e.g. English) and then have external DLLs like "App.lt-LT.dll" or "App.it-IT.dll" for example. The application should load the corresponding DLL based on CultureInfo specified during application startup. This will also allow to list available languages inside the UI, and correct mistakes without re-deploying the entire application, but only the language DLL.

Is it possible to do something like this?

I am using VS2022 .NET8 (C# 12). Currently targeting Windows 10 Enterprise.

Upvotes: 0

Views: 95

Answers (0)

Related Questions