7/23/2016 CSC 325 Advanced Programming Techniques Localization Slide #1 1 Localization Mikhail Brikman.

Slides:



Advertisements
Similar presentations
Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD.
Advertisements

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.
11 ASP.NET Slides based off:. 22 B ACKGROUND - W EB A RCHITECTURE Web Server PC/Mac/Unix/... + Browser Client Server Request:
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Creating a Console Application with Visual Studio
Creating Multi-lingual Applications and Websites with Microsoft Visual Studio 2005 Achim Ruopp International Program Manager Microsoft Corporation.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Sophia Antipolis, September 2006 Multilinguality, localization and internationalization Miruna Bădescu Finsiel Romania.
A First Program Using C#
Topics Introduction Hardware and Software How Computers Store Data
Intro to C# Dr. John P. Abraham UTPA. Background required Thorough C++ programming – If you made an A in 1370/1170 you will do fine with some effort.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
Microsoft Visual Basic 2005: Reloaded Second Edition
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Computing IV Visual C Introduction with OpenCV Example Xinwen Fu.
Tutorial 11 Using and Writing Visual Basic for Applications Code
Using Visual Studio 2013 An Integrated Development Environment (IDE)
WEB326 ASP.NET 2.0: Going Global Gets Easier! New Localization Features in ASP.NET 2.0 Michele Leroux Bustamante Architect, IDesign Microsoft Regional.
The Company….  The Market Leader in Globalization Technology –Pioneers in visual translation environments –Solutions for major platforms & programming.
© 2011 Autodesk CP5239 Demand-Loading AutoCAD®.NET Plug-ins James E. Johnson Synergis Software Sr. CAD Developer.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Bing Hong OSIsoft Internationalization &
Globalization Support in Microsoft.NET Framework François Liger Program Manager Microsoft Corporation.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 26 Internationalization.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Chapter 19: Visual Lisp. After completing this Chapter, you will be able to do the following: What is AutoLISP Launching Visual LISP Terminology and Fundamental.
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.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 14 Globalization Support in the Database.
Localization Support in Microsoft.NET Framework François Liger Program Manager 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.
Week 7 Lecture 2 Globalization Support in the Database.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
I18n = g11n + L10n Adam Long & Sam Soubra QSR International March 2009.
DEV392.NET Framework: Building Applications With Globalization In Mind Michele Leroux Bustamante Principal Software Architect IDesign Inc.
1 Chapter 20 Internationalization. 2 Objectives F To describe Java's internationalization features (§ 20.1). F To construct a locale with language, country,
Creating a Java Application and Applet
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Lesson 6-Using Utilities to Accomplish Complex Tasks.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Random Logic l Forum.NET l Localization & Globalization Forum.NET ● May 29, 2006.
Chapter 2: The Visual Studio .NET Development Environment
INF230 Basics in C# Programming
Metropolia 2013 C# programming and .NET framework
Topics Introduction Hardware and Software How Computers Store Data
Globalization support in ASP.NET
Guide To UNIX Using Linux Third Edition
CE-105 Spring 2007 Engr. Faisal ur Rehman
How to design a Windows Forms application
Using Visual Studio with C#
Module 1: Getting Started
Social Media And Global Computing Introduction to Visual Studio
Developing International Applications with Visual Studio 2005
CIS16 Application Development Programming with Visual Basic
Topics Introduction Hardware and Software How Computers Store Data
Chapter 35 Internationalization
Double click Microsoft Visual Studio 2010 on the Computer Desktop
MS Confidential : SharePoint 2010 Developer Workshop (Beta1)
Presentation transcript:

7/23/2016 CSC 325 Advanced Programming Techniques Localization Slide #1 1 Localization Mikhail Brikman

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #2 2 Chapter 28 Topics Discussed Classes representing cultures/regions. Localization resources. Globalization.

Application Internationalization Internationalization == i18n. System.Globalization namespace represents culture related information (language, country/region, calendars in use, format patterns for dates, currency, and numbers, and sort order for strings).System.Globalization An application can be localized easier if the executable code has been separated from the localizable resources – one per each locale supported. CLR uses satellite assembly resource model to support separation of code and resources.resource model Executable code is in the main assembly and resources are in the resource files compiled into separate DLLs. 7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #3 3

Unicode Character encoding.Character encoding Unicode Consortium.Unicode Consortium.NET is based on Unicode UTF-16. System.Text namespace represents ASCII, ANSI, Unicode, and other character encodings.System.Text 7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #4 4

Cultures and Regions - I CultureInfo class specifies a unique name for each culture, as a combination of an ISO 639 two-letter lowercase culture code associated with a language and an ISO 3166 two-letter uppercase subculture code associated with a country or region, e.g. ja-JP for Japanese (Japan) and en-US for English (United States).CultureInfoISO 639ISO 3166 Neutral culture is specified by only the two-letter lowercase language code, e.g. "fr" for French and "de" for German. Invariant culture is culture insensitive and is set by name represented by an empty string (""). 7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #5 5

Cultures and Regions - II To save culture specific data use an invariant culture, a binary format, or a specific culture independent format. National Language Support API Reference.National Language Support CultureInfo.CurrentCulture property returns a get/set property Thread.CurrentCulture – the culture used by the current thread.CultureInfo.CurrentCultureThread.CurrentCulture CultureInfo.CurrentUICulture property returns a get/set property Thread.CurrentUICulture – the culture used by the Resource Manager to invoke culture specific resources at run-time.CultureInfo.CurrentUICultureThread.CurrentUICulture 7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #6 6

Cultures and Regions - III Number/date localization: chapter28\LocalizationDemos.sln -> NumberAndDateFormatting.csproj chapter28\LocalizationDemos.sln -> CultureDemo.csproj – uses NLS locale identifiers CultureInfo.Parent.LCID from National Language Support.National Language Support String sorting is culture dependent: chapter28\LocalizationDemos.sln -> SortingDemo.csproj 7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #7 7

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #8 8 Embedding Resources - I chapter28\Resources\Wrox.ProCSharp.Localization.MyResources.txt Resources describe data logically deployed with an application: error messages, text, images, and persisted objects. Stored in resource files so that the data can be modified without recompiling the application. System.Resources.ResourceManager class provides access to culture specific resources at run time.System.Resources.ResourceManager

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #9 9 Embedding Resources - II Resource file generator Resgen.exe is a command- line utility that converts text (.txt or.restext) files and XML-based resource format (.resx) files to common language runtime binary (.resources) files that can be embedded in a runtime binary executable or compiled into satellite assemblies.Resgen.exe ResXResourceWriter class writes resources in XML format.ResXResourceWriter ResourceWriter class creates binary resource files.ResourceWriter

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #10 10 Embedding Resources - III chapter28\LocalizationDemos.sln -> CreateResource.csproj Generates chapter28\CreateResource\bin\Debug\Demo.resx – open to view in Visual Studio. Resource handling options.Resource handling options

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #11 11 Embedding Resources - IV VS 2015 provides resource creation options listed below. Creating Resource Files:Creating Resource Files  Manually create a text file with string resources.  Manually create an XML resource (.resx) file with string, image, or object data.  Programmatically create an XML resource (.resx) file using System.Resources namespace. Programmatically System.Resources  Programmatically create a binary resource (.resources) file.  Use Visual Studio resource editor to create a resource file and to include it in the project.

Embedding Resources - V Resource access at run-time: 1.Strongly typed resource is a compile-time feature that encapsulates access to resources by creating classes that contain a set of static read-only (get) properties. Open resource file (create using Resources tab in the VS Properties window if the file does not exist) in Visual Studio and set “Access Modifier” to public or internal.Strongly typed resource 2.Using the GetString and GetObject methods of the ResourceManager class.GetStringGetObject ResourceManager chapter28\LocalizationDemos.sln -> ResourceDemo.csproj, Demo.resx, Demo.Designer.cs 7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #12 12

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #13 13 Code Localization Assembly resource files *.resx. Edit in Visual Studio. Each resource is named with a unique string identifier. Supports localization == resource is dependent on the culture. chapter28\LocalizationDemos.sln -> BookOfTheDay.csproj, Properties -> Resources Command line arguments in Visual Studio: Solution Explorer -> Project Name -> Properties -> Debug tab -> Command line arguments.

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #14 14 Satellite Assemblies - I.NET uses hub and spoke model to package and deploy resources.hub and spoke Hub is the main assembly that contains the non- localizable executable code and the resources for a single (neutral or default) culture. Default culture == fallback culture for the application. Each spoke connects to a satellite assembly (DLL) that contains the resources for a single culture, but does not contain any executable code.

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #15 15 Satellite Assemblies - II Contain only resources. New resources can be added dynamically after deployment. To add a resource in VS: "Solution Explorer" → Right-click the project name → "Add" → "New Item" → “Visual C# Items” → "Resources File". Only assemblies for the current culture are loaded into memory at the startup. Each resource must have the same unique string identifier in all cultures.

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #16 16 Satellite Assemblies - III Resource files naming conventions: 1.filename.resx 2.filename..resx 3.filename. -.resx The first file in the list is the default resource file so if the application does not have a localized version of a particular language and culture the default resource file will be used. Subsequent items are resource files for specific language. Example: Forms.resx, Forms.en-GB.resx, Forms.pl.resx, Forms.de-DE.resx

7/23/2016 CS 325 Advanced Programming Techniques Localization Slide #17 17 Satellite Assemblies - IV Visual Studio automatically creates satellite assemblies for all cultures: chapter28\BookOfTheDay\bin\Debug\de chapter28\BookOfTheDay\bin\Debug\fr If the code does not specifically request a culture, the current culture is used by default == fallback.