问题
I got problem with localizing my Windows Phone 8.1 application. I would like to create checkbox with text "I accept rules", where "rules" is hiperlink to another view. I've no idea how to bind word "rules" with my .resw file.
<CheckBox>
<TextBlock TextWrapping="WrapWholeWords" x:Uid="/RegisterPage/RulesAccept">
<Hyperlink NavigateUri="" x:Uid="/RegisterPage/RulesAcceptHyperlink"/>
</TextBlock>
</CheckBox>
Now, RulesAccept is "I accept" and "RulesAcceptHyperlink" is "rules" but in my application word "rules" is not visible.
回答1:
Try like this:
<TextBlock TextWrapping="WrapWholeWords">
<Run x:Uid="RulesAccept"/>
<Hyperlink NavigateUri="">
<Run x:Uid="RulesAcceptHyperlink"/>
</Hyperlink>
</TextBlock>
Then in Resources.resw file specify which properties should change:
RulesAccept.Text = "I accept"
RulesAcceptHyperlink.Text = "rules"
You can find more about Localization here at MSDN.
来源:https://stackoverflow.com/questions/27595819/hyperlink-text-value-in-resw-resources