Welcome to the Axosoft Community, Sign in | Register | Help
in Search

Dan Suceava

Everything & Nothing

Localizing OnTime

Internally, the code in OnTime has been set up for localization since version 5 (OnTime 2005), as far as string resources go.  Until just recently, however, we have not attempted to translate it into any other language (due to various different reasons).  We are very excited about an opportunity to enter the Japanese market, and have started working on localizing OnTime for Japanese users.  This will also get OnTime completely ready for localization in other languages as well.

We had placed all our strings into resource files, however we created a different resource file for each assembly.  We did have an external resources assembly which was used for some of the common strings, but most string were inside the individual assembly resource files.  We already knew it would be better to have all resources in one file, because it makes it more manageable and avoids duplication of data, and helps make the translation process easier.  So we merged all our resource files into the one external file, and of course we ended up with quite a few duplicate resources.

What’s a developer to do when faced with the task of finding duplicate data in a 13k line XML file?  Write code, of course.  And not just any code, but a VS.NET add-in that can check for duplicate resource names in a resource file.  The add-in simply looks through the currently open .resx file and prints out the names of all the duplicate resources.  The process of figuring out if the resources are duplicates or just happen to have the same name still needs to be performed manually.  The reason I mention this add-in is because we are making it, and the code, available for download to anyone who may need it (at the very least it can make for a good sample VS integration package).

But wait … there’s more!

While we’re waiting for the Japanese version of our resource file, we know we have to adjust our UI (forms, controls, etc.) to fit the translated strings.  We are going to try making adjustments that can hopefully address all (or most) languages, and not have to adjust on a per language basis.  So we needed a quick way of testing OnTime with different languages to see how it looks and what needs changing. 

Well, thanks to Google I’ve been able to write some code to translate our resource file.  The handy VS.NET add-in that I wrote for checking duplicates just got a new feature (and is therefore on version 2.0 ?) that reads the currently open .resx file and translates each string to Spanish, German, French, or Italian.  Google supports translation to Japanese, Chinese, and Korean as well, which can be easily supported by the add-in (as a matter of fact it just needs the menu items and function calls with the appropriate language string).  The code simply takes each string and posts it to Google’s translation page - http://www.google.com/translate_t , then parses the response for the translated string (why does Google not offer an API for translations? – or did I miss it?).

All this code is included in the download, and is hopefully useful to someone out there.  Now keep in mind that this code was written for a quick solution to a problem, and not for performance or much usability in mind.  It also does not translate properly every string in the resource file, it’s definitely not intended to replace a proper translating service, but it’s extremely useful for testing purposes.  It can help give you a good idea of how your application looks in a different language.  It does the work, which is to translate a resource file to another language for testing-only purposes, though not necessarily in the best way possible. 

Quick information about the code:

  • written in C#
  • requires .NET 1.1
  • if you want to compile the code you most likely need the VSIP 7.1 SDK (see http://msdn.microsoft.com/vstudio/extend/ )
  • if you just want to register the package and try/use it (I’ve included the VSIPRegPkg.exe file that comes with the VSIP SDK):
    •  from the debug folder run:
      • vsipregpkg resexhelper.dll
    • from the VS.NET Common7\IDE folder run:
      • devenv /setup
  • I’m sure you can very easily compile it using .NET 2.0 and run it in VS.2005
  • and most importantly, this code/application is provided as is, Axosoft does not support or promote it 

With that said, you can download the zip file here.

Lastly, I just want to point to a couple of really good links on localization and globalization of .NET applications:
http://www.agiledeveloper.com/articles/LocalizingDOTNet.pdf
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconinternationalapplicationsinvisualbasic.asp

Published Monday, April 03, 2006 6:27 AM by Dan Suceava

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

TrackBack said:

paraesthesia

Originally posted by:

April 6, 2006 11:30 AM
 

TrackBack said:

July 5, 2006 9:21 PM
 

TrackBack said:

July 5, 2006 9:27 PM
 

Dave said:

I've worked on alot of localisation projects and what you describe here is a very clever form of what we called Pseudo Translation.

Basically our translation tools allowed us to replace the source strings with a Pseudo language which contained extended characters and also buffer out the string using a defined extra percentage.

E.g. the "Submit" button string would look something like this "[$úbmìtçö]".

The square brackets used so that any UI truncations can be easily spotted if a bracket is missing.

The extended characters used to see make sure that the internal code and displaying UI works correctly outside of the US character set.

This is a great process to introduce because it allows the testing of the localisation process even very early on in the development cycle making sure that the code is truly internationalized and that the dev \ build \ translation tools and processes can actualy work with all character sets.

May 2, 2007 7:04 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit



© 2002 - 2007, Axosoft, LLC. All Rights Reserved. | Privacy
Bug Tracking | Defect Tracking Videos | Help Desk Software