MultiBinding with StringFormat and localization using VisualBaml

283 Views Asked by At

I am writing a WPF application, which is then translated using VisualLocBaml. VisualLocBaml works mostly fine and allow me to translate all relevant strings, except for the StringFormat I use for a multibinding.

Here is the XAML portion of the code that has the multibinding:

<TextBlock x:Uid="TextBlock_3" TextAlignment="Center" FontSize="24">
    <TextBlock.Text>
        <MultiBinding x:Uid="MultiBinding_1" StringFormat="Your ladder position at {0} is {1}">
           <Binding x:Uid="Binding_1" Path="localInfos.Town" />
           <Binding x:Uid="Binding_2" Path="userInfos.Pos" />
        </MultiBinding>
    </TextBlock.Text>
</TextBlock>

I tried adding some Localization attribute as described here : https://msdn.microsoft.com/en-us/library/ms753944(v=vs.110).aspx, like this:

<TextBlock x:Uid="TextBlock_3" TextAlignment="Center" FontSize="24" Localization.Attributes = "$Text(Modifiable Readable)">
    <TextBlock.Text>
        <MultiBinding x:Uid="MultiBinding_1" StringFormat="Your ladder position at {0} is {1}" Localization.Attributes = "$StringFormat(Modifiable Readable)">
           <Binding x:Uid="Binding_1" Path="localInfos.Town" />
           <Binding x:Uid="Binding_2" Path="userInfos.Pos" />
        </MultiBinding>
    </TextBlock.Text>
</TextBlock>

But it didn't help: the StringFormat "Your ladder position at {0} is {1}" is still the only relevant string that is not available to translate in Visual LocBaml

0

There are 0 best solutions below