oleg-shilo / wixsharp

Framework for building a complete MSI or WiX source code by using script files written with C# syntax.
MIT License
1.1k stars 174 forks source link

Translation fails for Messages #1045

Closed hcarsten closed 2 years ago

hcarsten commented 3 years ago

We added recently a second language to our setup. I main point is that we would like to ship a MSI file and not a BootStrapper with an included transform.

Here I followed mainly the sample under "Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/MultiLanguageUI". This works pretty fine, accepts that pur main (or neutral) language is German I had to add a full translation file for en-us also. Anyway was easy to fix.

BUT, it seems that it is NOT enough to only do something like this : runtime.UIText.InitFromWxl(e.Session.ReadBinary("de_xsl")); It works in general to load dialogs but does NOT work to (re-)initialize the messages in the progress-dialog. Here we have still the language specified for the project. Is there any way to switch the language dynamically ?

best

Carsten

oleg-shilo commented 3 years ago

It's a difficult one. I cannot really say why it behaves this way. At runtime, the progress dialog receives presumably translated messages and only formats them

currentAction.Text = "{0} {1}".FormatWith(currentActionLabel.Text, message);

I suggest you create your project from the "Custom UI" VS project template. This way you will have the access to the ProgressDialog.cs so you can debug and experiment with the translation directly.

image