PowerPoint Presentation - DriveHQ by dfhdhdhdhjr

VIEWS: 2 PAGES: 33

									                      Localization &
                      Globalization




                                   Forum .NET ● May 29, 2006




Random Logic l Forum .NET l 2006                               1
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 2006                     2
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 2006                            3
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 2003.
    VB .NET 2005.
 What’s new in .NET 2005?


 Random Logic l Forum .NET l 2006               4
Random Logic l Forum .NET l 2006   5
First, What do we need to translate?


 Texts
 Images /
  Flash
 Database
  (Dictionary
  tables)
 Emails
  (Unicode
  text files)

  Random Logic l Forum .NET l 2006     6
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 2006   7
3 main Problematic linguistic
issues:
    Problem: words order changes in localized files.
    Solution: concatenated strings and variables.
                                                                                   1




    The problem happens when we have different order and the string contains parameters.

    Random Logic l Forum .NET l 2006                                                        8
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.
  From %%From%% To %%To%% Players.         %%From%% ~ %%To%% 人のプレイヤー獲得.

            English                                Japanese




  Random Logic l Forum .NET l 2006                                            9
Linguistic Issues (Cont.)
    Problem: In Europe, decimals are usually represented by commas.
                                                                               2
    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     3
     out, rather than numerically to avoid confusion.


     June 12, 2006
     USA: 6/12/06
     Europe: 12/6/06                    Cultural issues- won’t be discussed.

    Random Logic l Forum .NET l 2006                                               10
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 2006               11
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 2006                                    12
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 2006                                  13
Random Logic l Forum .NET l 2006   14
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 2006                         15
Tools for Resource files:
 .NET Editor
 Resourcer.exe
 CuteHTML.exe




 Random Logic l Forum .NET l 2006   16
.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 2006                              17
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 2006                               18
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 2006                               19
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 2006                                  20
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 2006                                  21
Random Logic l Forum .NET l 2006   22
                                   Example code




Random Logic l Forum .NET l 2006                  23
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 conventions           Fallback

     Random Logic l Forum .NET l 2006                              24
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 2006                                             25
Fallback mechanism:
A process that locates
appropriate resources.




  Random Logic l Forum .NET l 2006   26
Random Logic l Forum .NET l 2006   27
    Example code-
    Generating Html




    Another option is:


Random Logic l Forum .NET l 2006   28
    Example code-
    Culture Initialization




    Another option is:


Random Logic l Forum .NET l 2006   29
    Example code-
    Cultural formats




Random Logic l Forum .NET l 2006   30
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 2006               31
More Information…
•   http://msdn.microsoft.com/asp.net/community/authors/mlb/default.aspx?pull=/library/en-us/dnvs05/html/asp2local.asp
•   http://www.dotnetjunkies.com/WebLog/anoras/archive/2005/02/13/54271.aspx
•   http://msdn2.microsoft.com/en-us/library/ms227427(VS.80).aspx
•   http://www.bhashaindia.com/Developers/tutorial/dotnet/ASPLocalizationFeatures.aspx
•   http://www.code-magazine.com/Article.aspx?quickid=0503081
•   http://msdn2.microsoft.com/en-us/library/bz9tc508.aspx
•   http://msdn2.microsoft.com/en-us/library/sb6a8618.aspx
• http://msdn.microsoft.com/asp.net/community/authors/mlb/default.aspx?pull=/library/en-
us/dnvs05/html/asp2local.asp#asp2local_topic2
•   http://asp.net/QuickStart/aspnet/doc/localization/localization.aspx#langprefs
•   http://msdn2.microsoft.com/en-US/library/bz9tc508.aspx
•   http://www.net-translators.com/safot/Internationalization_i18n.asp
•   http://weblogs.asp.net/jasonsalas/archive/2005/05/04/405530.aspx
• http://66.249.93.104/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
• http://asp.net/QuickStart/util/srcview.aspx?path=~/aspnet/samples/localization/LocalizePers.src&file=LocalizePers_cs\Loc
alizePers_cs.aspx&lang=C%23+source
•   http://www.technoag.com/category/code/net/
•   http://msdn2.microsoft.com/en-us/library/e22s60h9.aspx




    Random Logic l Forum .NET l 2006                                                                                         32
                            Questions?
                            Thank You




Random Logic l Forum .NET l 2006         33

								
To top