Presentation is loading. Please wait.

Presentation is loading. Please wait.

10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Building multi-lingual ASP.Net application that handle western languages and Arabic with a single code base.

Similar presentations


Presentation on theme: "10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Building multi-lingual ASP.Net application that handle western languages and Arabic with a single code base."— Presentation transcript:

1 10 – 12 APRIL 2005 Riyadh, Saudi Arabia

2 Building multi-lingual ASP.Net application that handle western languages and Arabic with a single code base. Abdellatif Tarhine Microsoft Regional Director for North Africa Atarhine@Netopia-Solutions.com

3 Agenda Internationalizing Your Application What's New in APS.NET 2.0 Culture-sensitive Formatting Localization Resource Expressions Local and Global Resources Implicit Expressions to Local Resources Explicit Expressions to Local Resources Programmatic Access to Global Resources Localizing Static Content Storing Language Preferences

4 ASP.NET 2.0 Localization Features More tools built in to the Microsoft Visual Studio.NET 2005 environment. New runtime capabilities. Rich new programming API specifically targeting localization requirements.

5 Specifying Cultures How do you specify a culture? there is an Internet standard called RFC 1766 that specifies codes for cultures ar-SA—Arabic - Saudi Arabia en-GB—English—United Kingdom en-US—English—United States fr-FR—French - France zh-CN—Chinese - China the first part (lower case) specifies the language, and the second part (upper case) specifies a country or region

6 CurrentUICulture & CurrentCulture CurrentUICulture—specifies the culture for the user interface and is used for resource file lookups. CurrentCulture—specifies the culture for data and information. It is used to format dates, numbers, currencies and sort strings

7 how these settings work?

8 What's New in APS.NET 2.0 Auto Detection of Browser Language Declarative Localization Expressions Generating Local Resources

9 Culture-sensitive Formatting Setting a Preferred Language in Internet Explorer Auto-detecting the browser language for culture- sensitive formatting

10 Localization Resource Expressions There are two forms of resource expressions, explicit and implicit: Explicit Implicit

11 Localization Explicit Expressions to Local Resources Explicit localization expressions provide a way to declaratively assign specific resource entries to server control properties and other HTML elements ' PostBackUrl="http://www.idesign.net" meta:resourcekey="ImageButtonResource1" />

12 Localization Explicit Expressions to Local Resources Developers can create explicit expressions through the Properties window just as they would set other control properties

13 Localization Implicit Expressions to Local Resources The default behavior is for an implicit localization expression to be added to server controls, indicated by the parse-time attribute meta:resourcekey. Change Culture Settings

14 Localization Local and Global Resources Global resources: Reside in a specialized folder called /App_GlobalResources at the root of the application Local resources: defined in a peer-level /App_LocalResources folder

15 Localization Generating Local Resources ASP.NET 2.0 provides a simple way to automatically generate resources for Web pages Generate Local Resource from the Tools menu in Visual Studio 2005 Web Forms, user controls, and master pages can all be internationalized from within Visual Studio.NET 2.0. This particular view shows default resources generated for several pages.

16 Localization Localizing HTML Elements HTML Controls cannot participate in the benefits of implicit or explicit expressions unless they are run on the server (runat="server"). In fact the HTML page title element is special because it is also a Page property that can be set through the @Page directive. explicit expression that draws the value from shared resources instead of local resources ' %>

17 Localization Directional Attributes To control the directionality of the browser's scrollbars and set the overall directionality of the site, this explicit expression pulls correct value from shared resources, and uses a designer default, "LTR": ' >...

18 Localization Static Text A new ASP.NET Localize control is provided to mark static content as localizable Welcome! '>Welcome!

19 Localization Resource Localization and Deployment New declarative statements, automatic generation of page resources, and the presence of strongly-typed shared resources collectively make it much easier for developers to prepare Web applications for localization

20 Localization Preferred Culture Selection ASP.NET 2.0 introduces a new feature to automate culture selection at runtime based on Web browser preferences. The @Page directive, which also supports culture and UI culture settings, can be used to indicate that a particular page should be run based on the browser preferences:

21 Localization Preferred Culture Selection The web.config file for the application can also apply this setting for the entire application The colon after auto allows you to specify a default culture if the event HTTP headers are not available. Since culture must be set to a specific culture, the example above shows en-US as the culture.

22

23 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.


Download ppt "10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Building multi-lingual ASP.Net application that handle western languages and Arabic with a single code base."

Similar presentations


Ads by Google