Figure 12 1. Preparing the phone design surface for the internationalization demo in Office Word

Draw QR Code ISO/IEC18004 in Office Word Figure 12 1. Preparing the phone design surface for the internationalization demo

Figure 12 1. Preparing the phone design surface for the internationalization demo
Print QR Code ISO/IEC18004 In None
Using Barcode generator for Office Word Control to generate, create QR Code image in Microsoft Word applications.
www.OnBarcode.com
Generate Barcode In None
Using Barcode encoder for Microsoft Word Control to generate, create Barcode image in Office Word applications.
www.OnBarcode.com
Using the .NET Culture Hierarchy to Ensure Culture Neutrality
Creating USS Code 39 In None
Using Barcode drawer for Microsoft Word Control to generate, create ANSI/AIM Code 39 image in Office Word applications.
www.OnBarcode.com
QR Code Drawer In None
Using Barcode creator for Word Control to generate, create QR Code image in Microsoft Word applications.
www.OnBarcode.com
Suppose that you have built international support for only a portion of an application. What would happen when a user from a different country accesses features of an application that have not been internationalized Will the application stop working, display a blank screen, etc. The answer to this question lies in the concept of the .NET framework called culture hierarchy. There are three types of cultures that we as developers must be aware of: invariant, neutral, and specific. These cultures are arranged in a hierarchical manner, with invariant culture being at the top of the hierarchy, neutral in the middle, and specific culture at the bottom, as illustrated in Figure 12 3. When international users access Windows Phone 7 applications, the operating system starts at the bottom of this hierarchy and checks whether an application implements the specific culture of a given user. This check includes whether an application has the resources, such as text for menus and labels, which have been localized for the user s location. If such localized resources are not available, the system then moves up the culture hierarchy and checks whether there are provisions in the application for neutral cultures. Finally, if that check fails, the application defaults to the invariant culture, which is the same as English (US) culture.
Barcode Maker In None
Using Barcode maker for Microsoft Word Control to generate, create Barcode image in Word applications.
www.OnBarcode.com
Code 128 Code Set A Generation In None
Using Barcode drawer for Word Control to generate, create USS Code 128 image in Microsoft Word applications.
www.OnBarcode.com
CHAPTER 12 INTERNATIONALIZATION
GS1 - 13 Printer In None
Using Barcode generator for Word Control to generate, create EAN13 image in Microsoft Word applications.
www.OnBarcode.com
Draw USPS POSTal Numeric Encoding Technique Barcode In None
Using Barcode maker for Office Word Control to generate, create USPS POSTal Numeric Encoding Technique Barcode image in Microsoft Word applications.
www.OnBarcode.com
Figure 12 2. Running the internationalization demo For example, if a French-speaking user from Canada accesses Windows Phone 7 applications, the first thing the system checks is whether there are application resources implementing specific fr-CA culture. If that specific culture is not supported by an application, the system then performs a check of whether the neutral fr culture is supported. If the neutral culture is not supported, then the system defaults to the invariant culture, where none of the resources are localized.
QR-Code Decoder In VS .NET
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
Generating QR In Objective-C
Using Barcode creator for iPhone Control to generate, create Quick Response Code image in iPhone applications.
www.OnBarcode.com
Figure 12 3. Culture hierarchy in Windows Phone 7
Denso QR Bar Code Scanner In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Printing Universal Product Code Version A In Java
Using Barcode encoder for Eclipse BIRT Control to generate, create Universal Product Code version A image in Eclipse BIRT applications.
www.OnBarcode.com
CHAPTER 12 INTERNATIONALIZATION
Make EAN-13 In None
Using Barcode maker for Excel Control to generate, create EAN / UCC - 13 image in Office Excel applications.
www.OnBarcode.com
QR Code Generation In C#
Using Barcode creation for .NET framework Control to generate, create QR Code 2d barcode image in .NET framework applications.
www.OnBarcode.com
Storing and Retrieving Current Culture Settings
Code 128 Creator In None
Using Barcode drawer for Excel Control to generate, create Code 128B image in Microsoft Excel applications.
www.OnBarcode.com
Code 128B Drawer In VB.NET
Using Barcode drawer for .NET framework Control to generate, create Code 128 Code Set A image in .NET framework applications.
www.OnBarcode.com
On Windows Phone 7, the System.Globalization.CultureInfo class contains all of the necessary information about the phone s current culture settings. In this section, we will write code to retrieve basic properties of the CultureInfo class, as well as code to change the current culture of the phone and to react to those changes. In real-world applications, we are not likely to adjust the current culture in code, since the culture setting should be fully controlled by the user. In the following walkthrough, you will create a simple announcement of an upcoming event, and then, with a click of a button, adjust culture settings to properly display the date, time, and the cost of the event in a different region of the world Spain. To accomplish that, you will instantiate a new CultureInfo class and set the current thread s CurrentCulture property to this new class. Later on in this chapter, we will expand upon this walkthrough and make our event advertisement speak different languages without having to change the source code.
Encoding UCC.EAN - 128 In Objective-C
Using Barcode drawer for iPad Control to generate, create GS1 128 image in iPad applications.
www.OnBarcode.com
Creating Barcode In C#
Using Barcode generator for .NET framework Control to generate, create Barcode image in .NET applications.
www.OnBarcode.com
Note You are probably wondering by now where and how the Windows Phone 7 culture is set. On both the phone and the emulator, the culture is adjusted in Settings Region and Language. Region and Language Settings can be accessed by clicking the small arrow to the right of the tiles on the phone screen (it is right next to the Internet Explorer tile in the emulator). Click on Region Format, and select an international format from the list that you d like. Notice how both Short and Long Date properties, as well as the First Day of the Week property, adjust to the new format specific to the locale selected. Figure 12 4 illustrates how you can adjust Regional Settings on your phone.
European Article Number 13 Generation In .NET
Using Barcode creation for Reporting Service Control to generate, create European Article Number 13 image in Reporting Service applications.
www.OnBarcode.com
Linear Barcode Printer In .NET Framework
Using Barcode drawer for Visual Studio .NET Control to generate, create Linear image in .NET framework applications.
www.OnBarcode.com
Figure 12 4. Changing the phone s regional settings
CHAPTER 12 INTERNATIONALIZATION
1. 2.
Start by creating a Visual Studio project and naming it WP7LaunchParty. Double-click MainPage.xaml in Solution Explorer to bring up the XAML designer window.
For this first walkthrough, you will display the contents of just two fields on the screen: the name of the event as well as the event s date and time. 3. Let s go ahead and remove one of two default textblocks automatically added to the design surface by Visual Studio. Highlight the textblock with MY APPLICATION text in it (either in XAML or on the design surface) and hit the Delete key. Now let s add the additional six text box controls that you need. If the toolbox is not visible, either click the Toolbox button on the Visual Studio Application Bar or select View Other Windows Toolbox. Drag six textblocks to the design surface and position them two per row, one underneath each other, as shown in Figure 12 5. Change the text of the three textblocks on the left to the following: Event Date, Event Time, and Event Cost, as shown in Figure 12 5. Click on each textblock in the right column, press F4, and change the textblock names to txtEventDate, txtEventTime, and txtEventCost correspondingly. Finally, add a button to the design surface and change its content to Espa ol.
5. 6. 7.
You should now end up with XAML code that matches the XAML shown in Listing 12 1 (you can simply copy and paste XAML code from the source code downloads for this chapter instead of adding elements to the design surface one-by-one, as we ve done in the previous steps). Listing 12 1. WP7 Launch Party UI Code (XAML) <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!--TitleGrid is the name of the application and page title--> <Grid x:Name="TitleGrid" Grid.Row="0"> <TextBlock Text="WP7 Launch" x:Name="textBlockListTitle" Style="{StaticResource PhoneTextTitle1Style}"/> </Grid> <!--ContentGrid is empty. Place new content here--> <Grid x:Name="ContentGrid" Grid.Row="1"> <TextBlock Height="44" HorizontalAlignment="Left" Margin="204,48,0,0" Name="txtEventDate" Text="TextBlock" VerticalAlignment="Top" Width="276" /> <TextBlock Height="43" HorizontalAlignment="Left" Margin="5,49,0,0" Name="textBlock1" Text="Event Date:" VerticalAlignment="Top" Width="193" /> <TextBlock Height="44" HorizontalAlignment="Left" Margin="204,98,0,0" Name="txtEventTime" Text="TextBlock" VerticalAlignment="Top" Width="276" /> <TextBlock Height="43" HorizontalAlignment="Left" Margin="5,99,0,0" Name="textBlock3" Text="Event Time:" VerticalAlignment="Top" Width="193" />
Copyright © OnBarcode.com . All rights reserved.