1. Trang chủ
  2. » Công Nghệ Thông Tin

Thực hiện quốc tế hóa và tiếp cận ppt

10 121 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 260,31 KB

Nội dung

Implementing Internationalization and Accessibility Chapter 11 NIIT Implementing Internationalization and Accessibility 11.3 Activity 11.1: Implementing Internationalization Problem Statement The top level management at MusicMania has decided to open a new store in France. The management wants the website to be customized for French users. For this, the information displayed on the website needs to be in French language. In the initial phase, this functionality is to be implemented only on the home page so that the welcome message is displayed in French on the home page when the page is accessed by a user whose browser settings specify French as the preferred language. Prerequisite: Ask your faculty to provide you with the required starter files. Solution To customize the Home page for French users, you need to perform the following steps: 1. Modify the Home page. 2. Verify the application. Task 1: Modifying the Home Page To modify the Home page, you need to perform the following steps: 1. Open Microsoft Visual Studio. 2. Open the MusicMania website. 3. Double-click the Home.aspx file in the Solution Explorer window. The Home.aspx file appears. 4. Specify the UICulture and the Culture attribute of the Page directive to auto. 5. Switch to the Design view of the Home page. 6. Click the lbwelcomeuser label. 7. Select ToolsÆGenerate Local Resource. A folder by the name App_LocalResources is added in the Solution Explorer window and a file by the name Home.aspx.resx is created in this folder. 8. Create a copy of the Home.aspx.resx file in the App_LocalResources folder, and name it as Home.aspx.fr.resx. 11.4 Implementing Internationalization and Accessibility NIIT 9. Double-click the Home.aspx.resx file in the Solution Explorer window. The App_LocalResources\ Home.aspx.resx file is displayed, as shown in the following figure. The App_LocalResources\ Home.aspx.resx File 10. Locate the key, lbwelcomeuserResource1.Text, in the Name column of the App_LocalResources\ Home.aspx.resx file and type Welcome to MusicMania! in the Value column. NIIT Implementing Internationalization and Accessibility 11.5 11. Double-click the Home.aspx.fr.resx file in the Solution Explorer window. The App_LocalResources\ Home.aspx.fr.resx file is displayed, as shown in the following figure. The App_LocalResources\ Home.aspx.fr.resx File 12. Locate the key, lbwelcomeuserResource1.Text, in the Name column of the App_LocalResources\ Home.aspx.fr.resx file. 13. Type Bienvenue a' MusicMania! in the Value column. 14. Save all the files. Task 2: Verifying the Application To verify the application, you need to perform the following steps: 1. Set the Home.aspx file as the start page. 2. Press the F5 key to execute the application. The message, Welcome to MusicMania! appears on the home page. 11.6 Implementing Internationalization and Accessibility NIIT 3. Select ToolsÆInternet Options in the Web browser window. The Internet Options dialog box appears, as shown in the following figure. The Internet Options Dialog Box NIIT Implementing Internationalization and Accessibility 11.7 4. Click the Languages button. The Language Preference dialog box appears, as shown in the following figure. The Language Preference Dialog Box 5. Click the Add button. The Add Language dialog box appears, as shown in the following figure. The Add Language Dialog Box 11.8 Implementing Internationalization and Accessibility NIIT 6. Select French (France) [fr-FR] from the Language list and click the OK button. 7. Select French (France) [fr-FR] from the Language list in the Language Preference dialog box and click the Move up button. 8. Click the OK button. 9. Click the OK button in the Internet Options dialog box. 10. Press the F5 key to refresh the page. This time the message, Bienvenue a' MusicMania!, appears on the home page. 11. Close the browser. 12. Close the solution. 13. Exit Microsoft Visual Studio. NIIT Implementing Internationalization and Accessibility 11.9 Exercise 1 The top level management at New Tech Book store has decided to open new stores in Germany. The management also wants the New Tech Book store’s website to be modified in such a way that the information on the website can be displayed as per the German locale. As a developer, you need to display the current date on the Home page of the website. The current date should be displayed according to the language preference specified in the user’s Web browser. If the language preference specified in the Web browser is German (Germany), the current date should be displayed in the German format. Otherwise, the date should be displayed in the English-US format. Hint: To enable automatic culture determination, you need to set the culture and uiculture properties of the page to auto. Exercise 11.10 Implementing Internationalization and Accessibility NIIT

Ngày đăng: 12/08/2014, 17:21

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w