(X) Hide this
    • Login
    • Join
      • Generate New Image
        By clicking 'Register' you accept the terms of use .
        Login with Facebook

Internationalization/Globalization in Silverlight - Part 2 - Should I Internationalize?

(0 votes)
Ross Wozniak
>
Ross Wozniak
Joined Feb 19, 2010
Articles:   9
Comments:   0
More Articles
2 comments   /   posted on Feb 26, 2010

This article is compatible with the latest version of Silverlight.

I highly recommend that all .NET applications leverage Microsoft’s internationalization framework, regardless of whether or not there is a current business requirement for it. The main reasons are:

  • It is not all that difficult or time consuming to set an application up for internationalization at the onset of development.
  • It is much more difficult to internationalize an app after the fact, and no fun hunting through thousands of lines of code for every bit of text that appears on the screen. It is also not fun having to revisit the code every time QA finds a string that was missed…it is basically a testing and bug fixing nightmare.
  • If best practices are followed, it encourages a consistent approach to how resources (strings, dates, etc.) are handled throughout a project. Consistency is always a good thing.
  • It encourages use of the DRY Principle (Don’t Repeat Yourself).

Now let me just elaborate a bit on the last point. Let’s say, for example, that you are developing an application that has similarities to Microsoft Outlook. You may have the string ‘New’ that appears in more than one place.

The File menu:

The toolbar:

What you do not want to do is have the string ‘New’ appear twice in your code. If you do, you have violated the DRY Principle. What if one day the UI designer comes by and says “can we change New to Add?” Wouldn’t it be nice to make the change in one place? Think of all the time you use terms like Save, OK and Cancel in your app. Hmm.

What I try to do is having hard-coded strings anywhere in my code. I prefer to use constants, and in this case, draw the string from a .resx file.


Subscribe

Comments

  • -_-

    RE: Internationalization/Globalization in Silverlight - Part 2 - Should I Internationalize?


    posted by K.Kong on May 10, 2010 11:28
    "What I try to do is having hard-coded strings anywhere in my code."  Typo here?
  • -_-

    RE: Internationalization/Globalization in Silverlight - Part 2 - Should I Internationalize?


    posted by K.Kong on May 10, 2010 12:37

    About the DRY principle, it's dangerous if it's for single words or short phrases.  The word "New" used in different contexts can translate to different words in other languages!

    Hence, it is impossible to translate accurately if the translator is working with just the resource file, unless it is so fantastically commented.

Add Comment

Login to comment:
  *      *       
Login with Facebook

From this series