Silverlight 2 Multi-language support implementation (bottom)

Source: Internet
Author: User
Tags silverlight

Introduction

The recent project to localize in the Silverlight 2 application was thought to be a very simple process, but it didn't occur when it was twists, but the results were pretty good. The requirement is this, when the user first visits, the default is English, when the user chooses a display language, the record is local, the next time users visit directly show the language you have selected. Now I have recorded the whole process of realization and I hope it will help.

A wry smile without blemish

At the end of the multi-language support implementation (above) article in Silverlight 2, we achieved multi-language support by modifying supportedcultures in the project file because there were only two languages in the previous example, Chinese and Chinese, Now we add a resource file Strings.fr-fr.resx to enable it to support French, as shown in the following figure:

Thanks to my colleague Fabien for helping me translate it into French, we also open the project file and add a language culture fr-fr to supportedcultures, which we can split with commas or semicolons, as shown in the following code:

Now we extract the Xap file, you can see FR-FR, ZH-CN resource files are properly packaged in the XAP file, the following figure:

Now when you run the program, you find that the Chinese language culture cannot be displayed, and the French can display it correctly:

This is a bug that Silverlight 2 Beta 2 supports in localization, and it can only support a language other than the default language. A friend might ask, why is it not Chinese in this example, but French, since it can support a language other than the default language? This is mainly in the language and culture set up in the SupportedCultures, after compiling, packaging to AppManifest.xaml to add Assemblypart is in accordance with the alphabetical order of language and culture, so will default to support the top one language culture:

Okay, now that you know that in Silverlight 2 Beta 2, you can support up to two languages, and hopefully at RTM the problem is gone.

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.