The WIN8 platform handles localized multilingual support relatively easily, but is slightly more complex than WP8, unlike the WP8 platform, where much of the work is done with VS IDE processing, and WIN8 platform operations require developers to handle the basics. And the use of it in XAML is slightly different.
It's also important to emphasize that whether your current application needs to support multiple languages, separating your code from localizable resources into a resource file is a good coding habit.
Localized MultiLanguage configuration
Refer to the directory structure in the following figure to create the strings folder as well as subdirectories and RESOURCES.RESW resource files.
Create a resource folder for each culture that the application supports, and add a resource file called APPRESOURCES.RESW for this folder, where the resource folder is the regional language, such as: Chinese (Simplified, Chinese): ZH-CN, 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. Windows prioritizes language matching in a standard, Easy-to-understand way. For example, in order of precedence, en-us is matched in turn with en-us, en, EN-GB, and so on.
The ZH-CN/APPRESOURCES.RESW resource file is shown below:
The EN/APPRESOURCES.RESW resource file is shown below:
Use of localized resources
With respect to the way localized resources are used and WP8, here's a simple example of a quick start: Using string resources (Windows Store application using C#-vb-c++ and XAML) (Windows).
Use in 1.XAML (associating a control to a resource)
<textblock x:uid= "Greeting" text= ""/>
Each control that needs to be localized for text must be associated with the. resw file. To do this, you can use the X:uid property of the XAML element, which is associated with the Text property of the TextBox x:uid as greeting.
2. Use in the code
Windows.ApplicationModel.Resources.ResourceLoader Resloader_ = new Windows.ApplicationModel.Resources.ResourceLoader (); Basetitle.text = Resloader_. GetString ("AppTitle");
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/