I'm making a UWP app with WinUI 2.8. I have a button control, and with a basic ToolTip in it.
How can I localize the ToolTip using localization tables?
Here's my XAML code of the button:
<Button
x:Name="SaveB"
x:Uid="Save"
Content="Save"
ToolTipService.ToolTip="Saves the input."
Click="SaveB_Click"
/>
What you need to do is to create resources files targeting different languages in your app and save the localized string in the files.
Here are the steps to create a localized string for en-US. You could take it as example.
Strings
, create a new sub-folder and name it "en-US".en-US
, create a new Resources File (.resw) and confirm that it is named "Resources.resw".Resources.resw
file.Like this:
The Xaml code should be like this:
<Grid>
<Button x:Name="SaveB" x:Uid="Save" Click="SaveB_Click" />
</Grid>
Result:
More information please refer to: Localize strings in your UI and app package manifest