Closed kipamgs closed 1 month ago
Will have a look at this on the weekend.
I'm merging the wxl file
Yes this is the correct technique.
Is it possible that you are not doing it at right time that is UIInitialized
project event:
You can find the relevant samples in the samples library:
I initialized it exactly as in the example. I created a small example project with the problem. Example.zip
Great, I will have a look on weekend.
OK, there are a few problems here. It's kinda a perfect localization storm :)
Please note I am reviewing your example that you shared.
ContentControl.Content
(e.g. in buttons) and TextBlock.Text
text. Though in your case did not set TextBlock.Text
property but a TextBlock.Content
property`
<TextBlock TextWrapping="Wrap"><Run Text="[UI_DB_URL_HINT]" /></TextBlock>
Thus WixSharp is translating the empty property Text
. To solve this problem you either need to set text manually or simply roll it back to TextBlock.Text
approach.
<TextBlock TextWrapping="Wrap" Text="[UI_DB_URL_HINT]"></TextBlock>
public SQLConnectionDialog()
{
InitializeComponent();
this.Loaded += (s, e) => this.Localize();
}
There are quite a few moving parts here, but basically, you will need to get rid of <Run
and call Localize
from the onLoad handler (or get rid of the ScrollViewer. But when the next release is out, the only constraint will be the use of <Run...
===========================
I have also added this information to the Localization wiki.
Thanks for the quick reply.
OK, there are a few problems here. It's kinda a perfect localization storm :)
Please note I am reviewing your example that you shared.
1. Small problem with your code ``` <TextBlock TextWrapping="Wrap"><Run Text="[UI_DB_URL_HINT]" /></TextBlock> ```
I overlooked that one.
2. Bigger problem with auto localization in WixSharp () In a meantime you can solve this problem by calling localization manually from the dialog onload event: ```cs public SQLConnectionDialog() { InitializeComponent(); this.Loaded += (s, e) => this.Localize(); } ```
There are quite a few moving parts here, but basically, you will need to get rid of
<Run
and callLocalize
from the onLoad handler (or get rid of the ScrollViewer. But when the next release is out, the only constraint will be is the use of<Run...
I couldn't ask for more than a 1 line solution :)
===========================
I have also added this information to the Localization wiki.
Thanks.
Nuget: WixSharp-wix4.WPF Version 2.3.1 (Also happens in earlier versions) Project was created with the
WixSharp Managed Setup - Custom WPF UI (WiX4)
template.As you can see in the image below not all strings are replaced with their value. The only of my custom values that is replaced is the lower left "Test Connection" button but all of them are defined in the same wxl file.
For now I can do a workaround and add
DatabaseURLHint.Text = _session?.Format(Host?.MsiRuntime().UIText["UIDatabaseURLHint"]);
for all strings to the Init function of the dialog but it would be nice to find the cause of this problem.I'm merging the wxl file with the existing english one with
runtime.UIText.InitFromWxl(e.Session.ReadBinary(lang_file), true);
..wxl:
XAML: