Automatically Translating resx Files Using Microsoft Translator

Back in April 2009 I wrote about the Microsoft Translator (aka the Bing Translator), the various APIs that it exposes and in particular the REST API that it exposes to allow the automation of translation. At the time I also added a Microsoft Translator class to the list of translator classes used in the tool suite for my book, .NET Internationalization. In this post I join the dots and show you how to make use of these classes and automatically translate your resx files to another language.

  1. Get your Microsoft Translator "app id" from http://search.live.com/developers/appids.aspx.
  2. Download the free source code for the book from here.
  3. Extract the source code to a folder of your choice.
  4. Open ResourceAdministration\ResAdmin\App.Config and change the "value" of the "MicrosoftTranslatorApplicationId" key to the "app id" that you were given for the Microsoft Translator.
  5. Build the source code by opening a Visual Studio command prompt in the folder that you extracted the source code to and running "msbuild BuildAll.proj". If FxCop is not installed on your machine there will be build errors but these are not related to the translation tools and you can ignore these.
  6. Connect to the internet (the Microsoft Translator needs an internet connection).
  7. In ResourceAdministration\ResAdmin\bin\debug you will find ResAdmin.exe. This is the Resource Administrator which is a developer tool for managing resources. Run ResAdmin.exe.
  8. You will see the following dialog. In the "Source of Resources" enter the base directory containing your resx files. In the "Invariant language" enter the language code that the original resources are in (e.g. "en" for "English"). Click OK. ResAdmin Resources Source
  9. Next you will see the main form. You need to tell the Resource Administrator what language(s) to translate to. Select Tools | Languages and enter all of the languages to translate to (you should probably de-select Albanian at this point). Click OK. ResAdminMainForm
  10. You will be asked if you want to automatically add the necessary resx files for the new language(s).ResAdminAddLanguages Click Yes. At this point if "Automatic Translation" is on (see the status bar) the text in the resx files will be translated.
  11. The Resource Administrator tool uses a collection of machine translators to translate text where it falls back to other suitable translators if one fails. You can configure which translators are included in the list by selecting Tools | Translators.

Note that the Resource Administrator utility is not hard wired to use solely resx files. You can use the same utility with other sources of resources (including a database) by selecting Tools | Resources Source.

For more information on how to use the Resource Administrator see the .NET Internationalization book.

Currently rated 3.8 by 4 people

  • Currently 3.75/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: guysmithferrier
Posted on: Tuesday, September 29, 2009 at 6:14 PM
Tags:
Categories: Internationalization | .NET Internationalization Book
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Silverlight Globalization Namespace Comparison Updated For Silverlight 3

I have updated the Silverlight Globalization Namespace Comparison document that I wrote a while back for Silverlight 3. The document compares all of the classes (and their properties and methods) in the System.Globalization of the .NET Framework with the same namespace in Silverlight. The update, however, is disappointing because there have been no changes in this area so the answers for Silverlight 3 are the same as for Silverlight 2.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: guysmithferrier
Posted on: Tuesday, September 29, 2009 at 5:51 PM
Tags:
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Poster Sessions

Last week I attended the Localization Research Centre's 14th annual conference in Limerick, Ireland. My role there was to present a poster session. This is a new format for me so I thought I'd take a moment to explain it. The idea is that you create a poster (A0 size in this case) about your chosen subject and the organisers print this out and hang it in an area with many other posters. At a given time (lunch time in this case) you stand next to your poster and answer questions about it to anyone who takes an interest. Here's a composite of 3 photos before anyone started (the composite was created by Microsoft's Image Composite Editor):-

Here is my "Internationalizing Silverlight" poster (complete with pasting error) together with another very interesting poster on English To Chinese Translation):-

I found it a really interesting idea and I think it would work at events in our industry. In some ways it is like the sadly unsuccessful Ask The Experts that was tried a few times at DDD in Reading. In the Ask The Experts format lots of experts hang around waiting for people to come up and ask them any question at all. It seemed like a good idea but it never worked which was a shame and at the time we couldn't see how to fix it. The poster sessions appear to solve the Ask The Experts problem by having a physical focus, a clear subject matter area and a ready made set of discussion points. We might try this out at DDD South West 2.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: guysmithferrier
Posted on: Tuesday, September 29, 2009 at 5:43 PM
Tags:
Categories: Miscellaneous - Other
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

VBUG Conference 2009

Under their new ownership VBUG are having their annual conference at TVP in Reading on Thursday 26th November 2009. There's some great speakers including the DevExpress Twins, Gary Short and Oliver Sturm, David Ringsell of PC-Talk and Rob Blackmore. I'll be doing a new version of an old presentation:-

  • Automating Testing Using Windows Virtual PC
    Windows Virtual PC is a free virtualization download from Microsoft for Windows 7. It allows you to run and maintain multiple virtual machines running different Microsoft operating systems in different configurations. Virtual Machines allow you to test your software in different configurations without the need for buying and maintaining separate physical machines. Unlike previous versions of Virtual PC, Windows Virtual PC includes an API for programmatically controlling these virtual machines. This session describes this API and shows you how to use it to run automated tests on multiple platforms. Subjects covered include basic use of the API, logging on to virtual machines, various methods for copying tests to virtual machines, running processes on virtual machines and collecting test results.
See you there.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: guysmithferrier
Posted on: Saturday, September 19, 2009 at 8:46 PM
Tags:
Categories: Events | Windows 7
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

LRC XIV: Localisation in The Cloud

The 14th annual LRC (Localisation Research Centre) conference will be held on Thursday/Friday 24th and 25th September 2009 in Limerick City, Ireland. I will be there presenting a poster. This is a new kind of presentation for me; the idea is to stand in a communal area during the break for lunch next to an A0 poster that you have prepared and be prepared to chat to anyone who is interested. It seems a bit like the Ask The Experts format but with better focus. If it works I might try it at dev events in the UK. My poster is on Internationalizing Silverlight and is based on the presentation that I have started giving this year. All in all I'm very excited about LRC as it will be a rare treat for me to be at a conference that is solely on localization and everyone there is guaranteed to be interested in the subject.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: guysmithferrier
Posted on: Tuesday, September 08, 2009 at 9:12 AM
Tags:
Categories: Internationalization | Events | Silverlight
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Alt.NET Bristol Beers #2

The second Alt.NET Bristol Beers will be held on Wednesday 16th September 2009 at the Portcullis in Clifton, Bristol. People will be around from 6:00pm and the voting starts at 6:45pm.

See you there.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: guysmithferrier
Posted on: Thursday, September 03, 2009 at 8:37 AM
Tags:
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed