Closed kipamgs closed 4 months ago
Sorry for the delayed response.
The English localization is stored in the same table where other localizations are, though under the WixSharp_UIText
key.
The English localization is always stored there regardless if you embed other languages or not.
At runtime you need to update the localization between dialogs. You do this by subscribing to the UI events that are triggered on the dialog change. Since you want to re-localize the second dialog then you need to do that right in the UILoaded event handler:
project.UILoaded += (SetupEventArgs e) =>
{
// first dialog is loaded
MsiRuntime runtime = e.ManagedUI.Shell.MsiRuntime();
runtime.UIText.InitFromWxl(e.Session.ReadBinary("WixSharp_UIText"));
e.ManagedUI.OnCurrentDialogChanged += (IManagedDialog obj) =>
{
// any dialog after the first one is loaded
// you can also check the dialog type here
};
};
Thank you
Hi, I added a combobox to the welcome dialog so the user can choose the language of the installer. I tried doing it in a similar way to the MultiLanguagesUI Example .
I would like to switch the languages if a user chooses another language of the combobox. The ideal way would be to load the localized strings in the ComboBox_SelectionChanged method.
Once I selected another language via
runtime.UIText.InitFromWxl
how can I switch back to english?