"WinRT" multi-lingual application name

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.