Random Logic l Forum.NET l Localization & Globalization Forum.NET ● May 29, 2006
Random Logic l Forum.NET l What is – Internationalization? Internationalization - The process of generalizing a product during the development process, so as to enable it to handle multiple languages and cultural conventions allowing adaptation of the product/program to different countries and cultures (also called locales) without necessitating redesign. Generalization is a synonym.
Random Logic l Forum.NET l What is - Localization / Globalization ? Localization (Customization)- The process of customizing your application for a given culture and locale (Localization consists primarily of translating the user interface). OR “Customization of the Internationalized product to a specific region”. Globalization- The process of designing and developing applications that function for multiple cultures. Globalization = internationalization + N x Localizations
Random Logic l Forum.NET l Agenda How to Localize? What do we need to translate? 3 primary linguistic Problems to handle. Three ways to internationalize: Advantages. Disadvantages. Resources tools. Examples: VB.NET VB.NET What’s new in.NET 2005?
Random Logic l Forum.NET l 20065
6 First, What do we need to translate? Texts Images / Flash Database (Dictionary tables) s (Unicode text files)
Random Logic l Forum.NET l Second, what about other cultural differences that need to be handled? Dates String order Regional attributes …… Therefore, we need to handle 3 main Problematic linguistic issues !!!
Random Logic l Forum.NET l main Problematic linguistic issues: Problem: words order changes in localized files. Solution: concatenated strings and variables. The problem happens when we have different order and the string contains parameters. 1
Random Logic l Forum.NET l Linguistic Issues (Cont.) For example: the problem is- The numbers come from the database. The text comes from the resource files. The order in each language is different. The solution: Use variables/parameters that will be replaced when the page is uploaded. English From %From% To %To% Players. Japanese %From% ~ %To% 人のプレイヤー獲得.
Random Logic l Forum.NET l Linguistic Issues (Cont.) Problem: In Europe, decimals are usually represented by commas. Solution: make sure numeric formats are internationalized (prevent that site from crashing whenever decimals are represented with commas). English German Problem: Different countries – different date formats. Solution: make sure you list out the date with the full month spelled out, rather than numerically to avoid confusion. June 12, 2006 USA: 6/12/06 Europe: 12/6/06 Cultural issues- won’t be discussed. 2 3
Random Logic l Forum.NET l There are three main ways to internationalize a site: Text files / Application Arrays. ResX / resource files (not compiled). ResX files compiled as assemblies. Every one of these generates the same result. The question is- which one is better for the project and which one is more comfortable for the developers/translator/other stakeholders.
Random Logic l Forum.NET l Text files / Application Arrays: An hierarchy of folders that holds text files with translations and translated images for all languages. Dictionary tables are also kept as text files. At the beginning, all of the texts and the image URLs are uploaded to an array that is saved in the cache / the application object and used during the site flow. A object that is responsible for uploading all of the data inside those files into arrays when the application is uploaded. The tooltip of every text, shows the ID of the text file that holds the translation for updating needs.
Random Logic l Forum.NET l Text files / Application Arrays : Advantages: The translators know exactly where the text is located according to the file name in the tooltip. The changes that are made can be checked on the spot by the translators (no compilation). There is no need for the developers to upload the changes again and again. Disadvantages: Many files (maintenance). Texts files are approached by numbers. All of the text is uploaded even if it isn’t usually used by the application. If there is lots of data it starts to slow down the site.
Random Logic l Forum.NET l
Random Logic l Forum.NET l Resource file tools: What do the translators want? Searching strings. Sorting the label IDs. Exporting to excel (for outsourcing needs). Copy, Paste and Cut options (with keyboard shortcuts). See changes online. Knowing the location of each label / text in the site. Understanding the context of the text.
Random Logic l Forum.NET l Tools for Resource files: .NET Editor Resourcer.exe CuteHTML.exe
Random Logic l Forum.NET l NET Editor: Advantages: XML Platform- very comfortable. Already inside the work environment which makes it easy for the developers. There is a FIND method. Disadvantages: .NET framework installation is needed. No “export to excel” option. The XML Platform is cumbrous because characters like,& are shown as codes which makes it unreadable. The other view is worse.
Random Logic l Forum.NET l Resourcer.exe: Advantages: .NET framework installation is not needed (a standalone application- exe file). The view is very comfortable because there is lots of space for translating and for reading. Disadvantages: There isn’t a FIND method, only SORT. Export to excel is not possible which makes it difficult when using an outsourcer. Copy / Cut / Paste without keyboard shortcuts.
Random Logic l Forum.NET l CuteHTML.exe: Advantages: .NET framework installation is not needed (a standalone application). The view is very comfortable because there is lots of space for translating and for reading. There is a FIND method. Disadvantages: The XML Platform is cumbrous because characters like,& are shown as codes which makes it unreadable. The other view is worse. Export to excel is not possible which makes it difficult when using an outsourcer.
Random Logic l Forum.NET l ResX / Resource files (not compiled): Advantages: No need for compilation when uploading a new version of the site text. Disadvantages: The reading is sequential - not efficient. The site will perform slower because the resource files are not compiled. We won’t discuss this method in details.
Random Logic l Forum.NET l Resource files compiled as assemblies: Advantages: Good performance. You can look for a specific key in the file and you needn’t scan the whole file using a cursor. Can be compiled as a different project. Disadvantages: Every time the translators change the resource file, the developer needs to compile the project and upload it. The developers has the same problem when they change values in the English file and want to observe the changes (A compilation is needed).
Random Logic l Forum.NET l
Random Logic l Forum.NET l Example code
Random Logic l Forum.NET l Steps: 1.Create a web-site. 2.Add a new Project for the language support (We want a satellite assembly (separate)). 3.Create a class that handles the retrieving of data from the resource files. 4.Add resource files per language following the conventions. 5.Add folders (one per language) for the images in the presentation layer and add images under them. 6.Add reference to the Multi Lingual DLL. 7.Create labels and images at server side and get their source from the resources. Naming conventionsFallback
Random Logic l Forum.NET l Naming conventions: Why? The common language runtime identifies a resource by its culture signature or name. How? Resource Files and Images folders: Each culture is given a unique name (two-digit lowercase). If required, a two-digit uppercase subculture name associated with a country or region is added. The subculture name follows the culture name, separated by a dash (-). For example: ja-JP, en-US. Labels inside the resources: lbl_[PageName]_[ContentDescription]- Text ERRMSG_[PageName]_[ErrorMessageDescription]- Error messages MSG_[PageName]_[MessageDescription]- Notification messages RFC
Random Logic l Forum.NET l Fallback mechanism: A process that locates appropriate resources.
Random Logic l Forum.NET l
Random Logic l Forum.NET l Example code- Generating Html Another option is:
Random Logic l Forum.NET l Example code- Culture Initialization Another option is:
Random Logic l Forum.NET l Example code- Cultural formats
Random Logic l Forum.NET l What’s NEW? Global / Local resources. An automatic creation of the default resource file. An attribute for all runat=server controls. Resource files are not compiled. 3 linguistic problems are no more problematic- simple solution.
Random Logic l Forum.NET l More Information… us/dnvs05/html/asp2local.asp#asp2local_topic2http://msdn.microsoft.com/asp.net/community/authors/mlb/default.aspx?pull=/library/en- us/dnvs05/html/asp2local.asp#asp2local_topic a9ec-f613621fa2ef/20-dotNetFr-L10n_c.ppt+localization+and+globalization+%2B+ResourceReader&hl=iw&gl=il&ct=clnk&cd=1http:// /search?q=cache:lajzdn2xmsEJ:download.microsoft.com/download/0/8/9/08901ad3-d0e2-4e7d- a9ec-f613621fa2ef/20-dotNetFr-L10n_c.ppt+localization+and+globalization+%2B+ResourceReader&hl=iw&gl=il&ct=clnk&cd=1 alizePers_cs.aspx&lang=C%23+sourcehttp://asp.net/QuickStart/util/srcview.aspx?path=~/aspnet/samples/localization/LocalizePers.src&file=LocalizePers_cs\Loc alizePers_cs.aspx&lang=C%23+source
Random Logic l Forum.NET l Thank You Questions?