Scott Hanselman

Psuedo Internationalization and your ASP.NET Application

April 09, 2005 Comment on this post [1] Posted in ASP.NET | Internationalization | Nant | ViewState | Bugs
Sponsored By

John Robbins has a great MSDN BugSlayer Article from April of 2004 on Psuedo Internationalization. When you're creating localization-ready applications, but you don't want to go to all the hassle of localizing your ever-changing resources to a specific language, you can create psuedo-internaFile Attachment: Psuedoizer.zip (11 KB)tionalized resources.

These are resources using not only funky characters (to cover more of the character spectrum), but they may be longer (simulating more 'verbose' languages like German).

For example, here's an English language snippet from one of our resource files:

<data name="Accounts.Download.Title">
  <value>Transaction Download</value>
</data>
<data name="Accounts.Statements.Action.ViewStatement">
  <value>View Statement</value>
</data>
<data name="Accounts.Statements.Instructions">
  <value>Select an account below to view or download your available online statements.</value>
</data>

Here's the same snippet Psuedo-internationalized:

  <data name="Accounts.Download.Title">
    <value>[Ŧřäʼnşäčŧįőʼn Đőŵʼnľőäđ !!! !!!]</value>
  </data>
  <data name="Accounts.Statements.Action.ViewStatement">
    <value>[Vįęŵ Ŝŧäŧęmęʼnŧ !!! !!!]</value>
  </data>
  <data name="Accounts.Statements.Instructions">
    <value>[Ŝęľęčŧ äʼn äččőūʼnŧ þęľőŵ ŧő vįęŵ őř đőŵʼnľőäđ yőūř äväįľäþľę őʼnľįʼnę şŧäŧęmęʼnŧş. !!! !!! !!! !!! !!!]</value>
  </data> 

It can still be read as near-English, which means you can localize your ASP.NET application to this funky almost-language and see:

  • Which strings in your application you missed pulling into resources
  • What you application looks like with longer strings
  • If you correctly handle the higher-order character sets

John's article includes a nice WinForms application to "psuedoize" resources. However his code doesn't take into consideration:

  • Resources that include markup like <a href={0}>. It will actually psuedoize the "a href" which will actually break your application. I've changed it to watch for the entering and exiting of < >'s and { }'s.
  • There's no command-line version.

I wanted a version to solve both these problems because I want to automatically psuedoize our applications during the Continuous Integration NAnt build. That means, Joe Developer adds a string, and the build will automatically generate psuedo-resources that include them all.

Here's my enhanced I18n Psuedoizer with much respect to John Robbin's original. Psuedoizer.zip (11.03 KB)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
October 07, 2005 5:20
Really nice one :-)
My experience leads me to believe there are a number of other potential issues that can derive from a pseudolocalization done like that, depending how complex is the application, so I prefer to prepend/append unicode strings to the english one.
Also, I'm not sure that it's a good practice to place the "a href" part in resources (just the URL)

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.