When you're on Windows Phone 8, it's hard to get the name of the application in the list and the name of the tile locked to the start screen to be multilingual, and you need to build a multi-language repository using C + +. However, in WinRT, this becomes much simpler and requires no more use of C + +, and resource files can be resolved. Of course, in WinRT, the name in the tile is consistent with the app name and is no longer differentiated.
First, we need to create the appropriate resource files (RESW) in the engineering catalog, such as:
The root folder must have a name of "Strings".
Then the name of the subfolder in the Strings folder is the language name, in Simplified Chinese and US English.
Next, add an entry in the RESOURCES.RESW file for testing:
ZH-CN's RESOURCES.RESW:
En-US RESOURCES.RESW:
Modify the mainpage.
<Pagex:class= "Localizationdemo.mainpage"xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local= "Using:localizationdemo"xmlns:d= "http://schemas.microsoft.com/expression/blend/2008"XMLNS:MC= "http://schemas.openxmlformats.org/markup-compatibility/2006"mc:ignorable= "D"Background="{ThemeResource Applicationpagebackgroundthemebrush}"> <Grid> <StackPanel> <TextBlockx:uid= "Txttest" /> </StackPanel> </Grid></Page>
The x:uid that defines a control is the same as the dot of the name in the resource file.
To run the program:
When ZH-CN:
Then go to Settings:
Enter language
Add language, find 中文版 (states)
After adding the restart, enter the program again.
Can see the effect, if not successful, please carefully check the above basic steps are successful !
The next step is to make the application name multi-lingual:
Add a new one in RESOURCES.RESW, here I named DisplayName.
ZH-CN's:
En-US:
The next key step is to modify the package.appxmanifest:
Like the picture above, modify the display name to ms-resource:D isplayname. Similarly, the instructions here can be modified in the same way.
The next step is to run.
ZH-CN:
En-US:
"WinRT" multi-lingual application name