Localized multilingual support for Windows Phone 8

Source: Internet
Author: User
Tags resource

It is easy to handle localized multi-language support on the WP8 platform, and most of the work has the VS IDE process, and developers need simple operations and translate local resources to achieve them.

Whether your current application needs to support multiple languages, it is important to separate your code from localizable resources. A common practice for localizing the UI text strings applied is to copy each string into a row in the string table of the resource file. Each original string is then replaced with a binding statement (XAML) or resource reference (code-behind) that points to the corresponding resource in the table. This is a good coding habit.

Localized MultiLanguage configuration

When an application is created, the Resource folder resources and a resource file named Appresources.resx are added to the application by default, as shown in the following figure. The Resourcelanguage value is the default language for the current system.

When you need to add additional language support, open the project properties, and under the Supported Cultures column, select the language you want to support, as shown in the following illustration.

Select "English" in the above image. A resource file named AppResources.en.resx is generated, the contents of the file replicate the default Appresources.resx content and the Resourcelanguage value is en modified. Each culture supported by the application has its own resource file, which is called appresources. {0}.resx, where {0} is a regional language, e.g. English: En, English (USA): en-us.

After the application is started, your localized application will implicitly load and display the resources that the culture most matches the display language of the user's phone. If there is no good match, the application will use a neutral language resource. The application code can explicitly override an implicit culture selection either by element or globally.

Related Article

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.