3

我正在编写一个 WPF 应用程序,然后使用VisualLocBaml. VisualLocBaml工作得很好,并允许我翻译所有相关的字符串,除了StringFormat我用于multibinding.

这是XAML具有以下代码的部分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>

我尝试添加一些本地化属性,如下所述:https ://msdn.microsoft.com/en-us/library/ms753944(v=vs.110).aspx ,如下所示:

<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>

但这并没有帮助:StringFormat“您在 {0} 的阶梯位置是 {1}”仍然是唯一无法翻译的相关字符串Visual LocBaml

4

0 回答 0