WEB326 ASP.NET 2.0: Going Global Gets Easier! New Localization Features in ASP.NET 2.0 Michele Leroux Bustamante Architect, IDesign Microsoft Regional.

Slides:



Advertisements
Similar presentations
The creation of "Yaolan.com" A Site for Pre-natal and Parenting Education in Chinese by James Caldwell DAE Interactive Marketing a Web Connection Company.
Advertisements

Master Pages, User Controls, Site Maps, Localization Svetlin Nakov Telerik Corporation
Building International Applications with Visual Studio.NET Achim Ruopp International Program Manager Microsoft Corporation.
Building Localized Applications with Microsoft.NET Framework and Visual Studio.NET Achim Ruopp International Program Manager Microsoft Corp.
Why.NET? Various languages struggling to interoperate with each other Developers undergoing huge learning curves to shift from one language to another.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Microsoft Office SharePoint Server Business Intelligence Tom Rizzo Director, Microsoft Office SharePoint Server
Windows XP Language Interface Packs (LIPs) - Localized OSs for the Masses Russ Rolfe Program Manager.
Connect with life Praveen Srvatsa Director | AsthraSoft Consulting Microsoft Regional Director, Bangalore Microsoft MVP, ASP.NET.
Creating Multi-lingual Applications and Websites with Microsoft Visual Studio 2005 Achim Ruopp International Program Manager Microsoft Corporation.
WEB329 ASP.NET: A Lap Around the New Enhancements for Web Developers in Microsoft Visual Studio 2005 Omar Khan Lead Program Manager Web Platform and Tools.
Create with SharePoint 2010 Jen Dodd Sr. Solutions Consultant
INTRODUCTION TO WEB DATABASE PROGRAMMING
DEV317 Integrating Extensible Business Graphics into Enterprise Applications using Visio 2003 Mai-lan Tomsen Bukovec Program Manager.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
OFC 322 Building Office Research Web Services: Exposing Corporate Data Through Office Brian Jones Program Manager Authoring Services Martin Sawicki Lead.
Think Global! Custom Cultures and International Data Matt Ayers Program Manager Windows International Achim Ruopp Program Manager Developer Globalization.
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
The Company….  The Market Leader in Globalization Technology –Pioneers in visual translation environments –Solutions for major platforms & programming.
Business Solutions Using Microsoft ® Office SharePoint ® Server ROADSHOW.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Globalization Support in Microsoft.NET Framework François Liger Program Manager Microsoft Corporation.
10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Building multi-lingual ASP.Net application that handle western languages and Arabic with a single code base.
DEV382 Building International Applications with the.NET Framework Christian Nagel Microsoft Regional Director Global Knowledge.
DEV337 Modeling Distributed Enterprise Applications Using UML in Visual Studio.NET David Keogh Program Manager Visual Studio Enterprise Tools.
Microsoft Dynamics NAV 2009 and Architecture Overview Name Title Microsoft Corporation.
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
Localization Support in Microsoft.NET Framework François Liger Program Manager Microsoft Corporation.
WEB320 Migrating ASP.NET 1.x Applications to ASP.NET 2.0 Stefan Schackow Program Manager Web Platform and Tools Team Microsoft Corporation.
Internationalization in ASP.NET 2.0. SQL Server 2005 – Data Columns Use Unicode datatypes in: Table columns, CONVERT() and CAST() operations Use Unicode.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Connect with life Vedant Kulshreshtha Technology Solutions Professional – SharePoint | Microsoft India
MBL 305 ASP.NET Mobile Controls: Best Practices Gökşin Bakir CSA Yage Ltd. Microsoft Regional Director.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Migrating from ASP.NET 1.1 to ASP.NET 2.0 Scott Guthrie Web Platform and Tools Team Microsoft Corporation
DEV392.NET Framework: Building Applications With Globalization In Mind Michele Leroux Bustamante Principal Software Architect IDesign Inc.
WEB322 ASP.NET Internals: Under the Covers – Exploring Internals, Page Lifecycle and the Compilation Model Simon Calvert Program Manager Web Platform and.
Microsoft Visual Studio 2005 Tools for the Office System: Building Office Solutions Using Visual Studio 2005 Tools for Office Andrew Coates Developer Evangelist.
DEV221 Windows Forms in Visual Studio 2005: An Overview Saurabh Pant Program Manager Microsoft Corporation.
ARC303 Planning a Global Release: Many Countries, Many Languages, One Process Houman PournassehRuss Rolfe Program ManagerProgram Manager Global Platform.
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
7/23/2016 CSC 325 Advanced Programming Techniques Localization Slide #1 1 Localization Mikhail Brikman.
ClickOnce Deployment (One-click Deployment)
Building Enterprise Applications Using Visual Studio®
DEV260 Microsoft Visual Studio 2005 Team System: Managing the Software Lifecycle with Visual Studio 2005 Team System Bindia Hallauer Senior Product Manager.
Metropolia 2013 C# programming and .NET framework
Introduction to ASP.NET 2.0
Globalization support in ASP.NET
Office 365 Development July 2014.
Business Connectivity Services in SharePoint 2010 and Office 2010
Visual Studio Tools for Office 2005
Enterprise Library Overview
Excel Services Deployment and Administration
Tech Ed North America /1/ :36 AM Required Slide
DAT381 Team Development with SQL Server 2005
Jochen Seemann Program Manager Enterprise Tools Microsoft Corporation
Pablo Castro Software Architect Microsoft Corporation
Visual Studio 2010 SharePoint Development Tools Overview
From Development to Production: Optimizing for Continuous Delivery
From Development to Production: Optimizing for Continuous Delivery
ClickOnce Deployment (One-click Deployment)
Office 365 Development July 2014.
Microsoft Dynamics.
Introduction to ASP.NET Parts 1 & 2
Mark Quirk Head of Technology Developer & Platform Group
Visual Studio 2005 IDE Features
Presentation transcript:

WEB326 ASP.NET 2.0: Going Global Gets Easier! New Localization Features in ASP.NET 2.0 Michele Leroux Bustamante Architect, IDesign Microsoft Regional Director

Michele Leroux Bustamante

Agenda Localization and the Web New Localization Features in 2.0 Generating Local Resources Localization Expressions Global Resources and Type Safety Runtime Culture Selection ASP.NET Architecture

What Is Globalization? Designing applications to be adapted to the global marketplace Display, input, formats & conventions Localizability Separate culture dependencies from code Localization Adapting applications for specific markets Content translation, feature customization Changes independent of compiled source

Locale/Culture Language and cultural environment International Standards Organization (ISO) Conventions Language Code: ISO (i.e., en, fr, es) Country Code: ISO 3166 (i.e., CA, EC) Together, they identify culture (i.e., es-EC) See RFC 3066 – Tags for identifying languages Custom cultures are sometimes necessary

What To Localize? Static (hard-coded) application content Menu/control captions, Web content, XML Dynamic application content Database, XML, other Graphical content Filenames, connection strings, queries

Storing Localized Content Deployment architecture is affected by location of localized application content Resources, file system, database, external applications Choices influenced by application type Microsoft Windows versus Web And by business requirements Frequency of culture translations Ease of translation process Frequency of application maintenance

Database Content Duplicate Site Content GlobalWeb.dll Products GlobalWeb\bin Global.asax Web.config logo.gif page and user control content

Database Content Duplicate Site Content GlobalWeb.dll Products Products_en-CA Products_es GlobalWeb \en-CA \bin \es Global.asax Web.config logo.gif logo.en-CA.gif logo.es.gif page and user control content translated page and user control content

Database Content Single Content Base GlobalWeb.dll Products Products_en-CA Products_es GlobalWeb\bin Global.asax Web.config logo.gif logo.en-CA.gif logo.es.gif Satellite Assemblies \en \en-CA \es GlobalWeb.en.dll GlobalWeb.en-CA.dll GlobalWeb.es.dll list.en-CA.xml list.es.xml resources resources resources resources translated file content

Agenda Localization and the Web New Localization Features in 2.0 Generating Local Resources Localization Expressions Global Resources and Type Safety Runtime Culture Selection ASP.NET Architecture

Localization Features in 2.0 Web Forms resource generator Localization expressions Strongly-typed resources Improved Resource Editor ResourceManager lifetime management Automatic culture selection New Microsoft ASP.NET deployment options New resource provider model

Agenda Localization and the Web New Localization Features in 2.0 Generating Local Resources Localization Expressions Global Resources and Type Safety Runtime Culture Selection ASP.NET Architecture

ASP.NET 2.0 and Resources XML Resources (*.resx) Generated for master pages, content pages, and user controls Accessible through page or control properties, declarative expressions, or other APIs Type-safe global resources Set multiple localized control properties in a single command

ASP.NET 2.0 and Resources (cont’d) App_LocalResources Generated automatically or by hand Per page, control App_GlobalResources Manual generation Shared, strongly-typed Pre-compile or deploy source files and let the resource build provider handle the rest

ASP.NET 2.0 and Resources (cont’d) ResourceManager lifecycle is handled automatically Resource providers are cached along with specific resource manager instances per local or global resource Default resource and satellite assemblies are loaded into application domain, like providers, and readily accessible ResourceManager is still thread-safe

Generating Resources From Design View, select Generate Local Resource from the Tools menu Localizable properties for server controls are stuffed into resources Non-localizable properties can be manually inserted Localization expressions are generated for each server control Page parser turns expressions into code to set properties from resources

Localizing Static Content The control can isolate blocks of static text for localization Participates in resource generation Based on the control, but can directly edit text in Design View Welcome!

Generating Local Resources Michele Leroux Bustamante Architect, IDesign Microsoft Regional Director

Agenda Localization and the Web New Localization Features in 2.0 Generating Local Resources Localization Expressions Global Resources and Type Safety Runtime Culture Selection ASP.NET Architecture

Localization Expressions ASP.NET supports new declarative binding expressions for connection strings, application settings and resources Extensible for custom bindings Automatically applied when resources are generated for a page Can hand-edit to control where resources are drawn from

Implicit Expressions After generating resources, meta:resourcekey indicates the resource prefix for this control Resources are generated with this prefix for all localizable properties Change Culture Settings ’

Explicit Expressions Set a specific property to a specific resource entry Can come from local page resources: Or, from a global resource: ‘ PostBackUrl=" meta:resourcekey="ImageButtonResource1" />

Binding Expression Editor Bindings can be set through the Properties window via Expressions editor dialog ClassKey specifies a global resource if applicable, omit for local resources ResourceKey specifies the resource entry to apply to the control property

Binding Expression Editor

Agenda Localization and the Web New Localization Features in 2.0 Generating Local Resources Localization Expressions Global Resources and Type Safety Runtime Culture Selection ASP.NET Architecture

Creating Global Resources Add a Resources file to the application Will be placed in a special App_GlobalResources directory

Creating Global Resources Add resources through the integrated Resource Editor Apply them to server controls using explicit expressions Or, write custom code to retrieve them at runtime ‘ PostBackUrl=" meta:resourcekey="ImageButtonResource1" />

Improved Resource Editor Integrated with Visual Studio Visually categorize resources by their data type More friendly interface Create new images/icons in place

Strongly-Typed Resources Global resources generate a type-safe class accessible via global Properties object

class Resources { private static System.Resources.ResourceManager _resMgr; private static System.Globalization.CultureInfo _resCulture; /*FamANDAssem*/ internal Resources() {} [System.ComponentModel.EditorBrowsableAttribute(…)] public static System.Resources.ResourceManager ResourceManager {…} [System.ComponentModel.EditorBrowsableAttribute(…)] public static System.Globalization.CultureInfo Culture {…} public static System.Drawing.Bitmap flag { get { return ((System.Drawing.Bitmap)(ResourceManager.GetObject("flag", _resCulture))); }

Global Resources, Expressions and Runtime Behavior Michele Leroux Bustamante Architect, IDesign Microsoft Regional Director

Agenda Localization and the Web New Localization Features in 2.0 Generating Local Resources Localization Expressions Global Resources and Type Safety Runtime Culture Selection ASP.NET Architecture

Runtime Culture Selection System.Threading.Thread.CurrentThreadCurrentUICulture Affects resource selection Defaults to system UI language, or: CurrentCulture Affects formatting and conventions Defaults to user locale, can be changed: Thread.CurrentThread.CurrentUICulture = new CultureInfo("es"); Thread.CurrentThread.CurrentCulture = new CultureInfo("es"); DateTime dt = DateTime.Now; String s = dt.ToLongDateString();

CultureInfo System.Globalization.CultureInfo Encapsulates language and region

Resources and Assemblies Satellite assemblies Generated from localized resources Hub and spoke model Pre-compiled or JIT-compiled for ASP.NET Resource build provider ResourceManager handles resource fallback to retrieve culture-specific entries at runtime

Resource Fallback Best match is current thread’s UI culture I.e., en-CA, en-US Neutral parent culture is next best fit I.e., en Last resort is default from main assembly (default) en-CA en-US en (default)

Resource Fallback Identify the default resource culture [assembly: NeutralResourcesLanguageAttribute("en")] Default resources will be used instead of searching for satellite assembly en-CA en-US en (default)

Culture-Specific Formatting System.Globalization Utility classes support formatting, sorting and conversion by culture Formatting Classes Sorting: SortKey, CompareInfo String comparison: CompareInfo Date and time: DateTimeFormatInfo Numbers: NumberFormatInfo Calendar data: Calendar

Automatic Culture Selection Based on browser language settings Application or page scope Can specify default culture I.e., “auto:en-US” <globalization requestEncoding=“utf-8" responseEncoding=“utf-8" fileEncoding=“utf-8" culture=“auto:en-US" uiCulture=“auto" />

Automatic Culture Selection Michele Leroux Bustamante Architect, IDesign Microsoft Regional Director

Agenda Localization and the Web New Localization Features in 2.0 Generating Local Resources Localization Expressions Global Resources and Type Safety Runtime Culture Selection ASP.NET Architecture

Single code/page base is easy with 2.0 No duplicate Web content per culture Generated page resources Make consuming resources per page easy Type-safe shared resources Make consuming common resources easy ResourceManager lifecycle Less code required, runtime handles it

Single Code/Page Base Low impact translations Improved productivity Fewer errors Less overall development effort Issues Managing iterations with translators Giving translators access to data sources Working with Web designers

Deployment Options Deploy application source Resources (.resx) are dynamically compiled into satellite assemblies Updates are not version controlled Source is not protected Deploy pre-compiled application Assemblies pre-generated, including a local and global resource assembly and its associated satellite assemblies Better version control and IP protection

Managing User Preferences Automatic culture selection is inadequate for enterprise applications Culture selection options: Auto (for default only) UI selection User registration Preferences should be persisted: Transient solutions include cookies or user session Persistent solutions should leverage profiles or data storage

Caching and Localization Caching is critical to site performance Caching localized pages requires custom caching per VaryByCustom

Caching and Localization GetVaryByCustomString must have access to the user’s preferred culture Initialize the thread earlier in page cycle Note: Session and Profile not available public override string GetVaryByCustomString(HttpContext context, string custom) { if (string.Compare(custom, "uiCulture", true, System.Globalization.CultureInfo.InvariantCulture) == 0 && System.Threading.Thread.CurrentThread.CurrentUICulture != null) { return System.Threading.Thread.CurrentThread.CurrentUICulture.Name; } else return base.GetVaryByCustomString(context, custom); }

Handling 1.1 Resources By default, localization expressions and resource providers do not interact with 1.1 resources Can port your 1.1 solution to data binding expressions and ResourceManager lifecycle management Custom expression builders and resource providers can help

Culture Preferences, Caching & Deployment Michele Leroux Bustamante Architect, IDesign Microsoft Regional Director

Michele’s Resources Michele’s Globalization Site: n.aspx n.aspx n.aspx Michele’s Blog: IDesign: Localization Partner Program:

Resources General guidelines on internationalization: General guidelines on internationalization: General questions: General questions: Developing International Software: (available here at the Tech-Ed store)

Resources Tech-Ed 2005 International Break-out Sessions Title Code ASP.NET 2.0: Going Global Gets Easier! New Localization Features in ASP.NET 2.0 WEB326 Deploying Office 2003 in a Multilingual Environment DSK345 Deploying Windows XP in a Multilingual Environment DSK350 Databases for the World: Best Practices for Search in Multilingual Data Sets Using SQL Server Collation for Sorting and Indexing DBA319 Microsoft Business Solutions–Axapta: A Truly Global Business Application BAP347 Supporting East Asian Languages in Global Exchange Deployments MSG369.NET Framework: Think Global! Custom Cultures and International Data DEV323 Databases for the World: Designing Multilingual Databases Using SQL Server 2005 DAT290 Planning a Global Release: Many countries, Many Languages, One Process ARC303

Resources Tech-Ed 2005 International Cabana Talks Dr. International’s Clinic Booth in the Community Cabana International Experts available all week longTitle Code Custom Cultures in Whidbey: An In-Depth Discussion DEVC21 Advanced Localization Architecture DEVC19 Windows XP MUI: Keeping it Localized & Secure DSKC07 Meet the Speakers From ARC303: Planning a Global Release ARCC04

Your Feedback is Important! Please Fill Out a Survey for This Session on CommNet

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.