Video: Internationalizing Silverlight at SLUGUK

In September I presented Internationalizing Silverlight at the Silverlight UK User Group (#SLUGUK) and Ian Smith (@irascian) has done a fabulous job of recording and editing it.

Before you watch it here are a couple of things to note:-

  • I have now automated the process of creating localized XAP files and you do not have to go through the manual steps that I mention in the video. You can read my blog post on this here.
  • On one of the slides I have a screen grab of "konnichiwa" in a Japanese font and my brain was clearly in neutral as I called it kanji when it is hiragana.
  • I concede Gordon Mackie's point that the correct translation of "Hello World" to French is indeed "Bonjour Tout Le Monde".

You can download the slides here, the source code here and the Silverlight MSBuild tasks here.


A huge thanks to Ian Smith for going to all this trouble to record and edit this. This is no small effort and Ian is doing a major service to our community in consistently recording these events for us. Thanks, Ian.

Be the first to rate this post

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

Posted by: guysmithferrier
Posted on: Monday, November 01, 2010 at 8:02 PM
Tags:
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Video: Twitter MicroPresentation

On Saturday at Modern .NET I gave my second micro-presentation. This time it was on Twitter. Micro-presentations are also called Pecha Kucha (Japanese for "chit-chat") and 20/20 so called because these presentations are always 20 slides where each slide is 20 seconds (because PowerPoint is set to auto-advance after 20 seconds). I recorded a sound track for the micro-presentation and recorded the slides and have put together a video (6 minutes 52 seconds) that you can download here. Phil Winstanley has a real video filmed on a camcorder that you can watch here (the first 10 seconds or so are missing but there's a better atmosphere).

Thanks to everyone who attended and endured my particular stance on this. Also thanks to @Plip for being such a good sport. And thanks to Phil Winstanley, Dave Sussman and all of the speakers for a great day.

One final thought to leave you with: DDD 9 is on Saturday 29th January 2011. They will probably be looking for micro-presentations there as well. Give it a go - it's loads of pain and stress fun.

Currently rated 1.0 by 1 people

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

Posted by: guysmithferrier
Posted on: Monday, October 25, 2010 at 3:06 PM
Categories: Events | Miscellaneous - Other | DDD
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Building Localized XAP Resource Files For Silverlight 4

The steps for localizing Silverlight applications using standard .resx files are relatively straight forwards. You can follow these steps on my "Internationalizing Silverlight" slides and see a completed demo in the downloadable source code for the same presentation (see the Localization101 folder). The main problem to resolve in this scenario is that the strongly typed resource class must be public and must have a public constructor. The solution to this problem lies in a previous blog post. This blog post discusses the next stage.

Silverlight faces the same deployment problem that ClickOnce applications face: if you follow the regular localization route then your deployment solution includes all languages for all users. Purely for performance reasons this is not desirable. The optimum solution is to provide the user with only the resources for the one required language. There is no built-in solution in Visual Studio 2010 that covers this scenario - that is what this blog post is about.

The solution is to build one XAP file with the Silverlight application and fallback resources (e.g. SilverlightApplication1.xap) and a separate XAP containing language-specific satellite resource assemblies for each deployed culture (e.g. SilverlightApplication1.fr-FR.xap, SilverlightApplication.es-ES.xap). At runtime the Silverlight application dynamically loads the required XAP resource file. In earlier versions of Silverlight this was possible using WebClient to download the XAP file and AssemblyPart.Load to load the satellite resource assembly into the Silverlight application's domain. This is still possible but MEF (Managed Extensibility Framework) provides a much neater solution (MEF, however, performs almost exactly the same steps as the original solution). To load and use the XAP resource file change the App.Application_Startup event in App.xaml.cs to:-

private void Application_Startup(object sender, StartupEventArgs e)
{
    string xapResourceFilename = String.Format("{0}.{1}.xap",
        "SilverlightApplication1",
        Thread.CurrentThread.CurrentUICulture.Name);

    DeploymentCatalog catalog = new DeploymentCatalog(
        new Uri(xapResourceFilename, UriKind.Relative));

    CompositionHost.Initialize(catalog);

    catalog.DownloadCompleted += (s, args) =>
    {
        this.RootVisual = new MainPage();
    };

    catalog.DownloadAsync();
}

This code uses MEF's DeploymentCatalog to load the XAP resource file (e.g. SilverlightApplication1.fr-FR.xap) containing the application's satellite resource assembly (e.g. SilverlightApplication1.resources.dll). The new MainPage is only created once the download is complete (or has failed). At this point the satellite resource assembly has been loaded into the Silverlight application's app domain and the regular ResourceManager (or whatever resource manager class you use) can get to work resolving the resources. You can see a completed demo in the downloadable source code (see the DownloadOnDemand folder).

The hardest part to solve in this process is the creation of the XAP resource files (e.g. SilverlightApplication1.fr-FR.dll). There is no support for this scenario in Visual Studio 2010 so you have to build this bit yourself. Or rather, you have to download the MSBuild tasks that I have created to solve this problem. Silverlight.Build.Tasks.zip contains the source code to build a library of MSBuild tasks (Silverlight.Build.Tasks.dll) and an MSBuild targets file (Silverlight.Build.Tasks.targets) that you add to your Silverlight application's .csproj file. Full details are in the solution's ReadMe.txt but in essence you add the following lines to the bottom of your .csproj file:-

<Import Project="$(ProgramFiles)\MSBuild\I18N\Silverlight\v4.0\Silverlight.Build.Tasks.targets" />

<Target Name="AfterBuild" DependsOnTargets="XapResourcePackager">
</Target>

Then you add the following line immediately below your .csproj's </SupportedCultures> line:-

<PackageCultures>fr-FR</PackageCultures>

(where <PackageCultures> contains a comma delimited list of cultures to create XAP resource files for).

The result is that when you build your Silverlight application the necessary XAP resource files are also built. If your Silverlight application has a corresponding website that hosts the Silverlight application then those XAP files are copied to the website's ClientBin folder just like the Silverlight application's XAP. You can see a completed demo in the downloadable source code (see the DownloadOnDemandAutomatedBuild folder).

Of course this only covers one Silverlight deployment scenario but it is common enough that it demands a solution.

Enjoy.

Currently rated 3.4 by 13 people

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

Posted by: GuySmithFerrier
Posted on: Sunday, October 10, 2010 at 10:25 PM
Categories: Internationalization | Silverlight
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (4) | Post RSSRSS comment feed

TechEd Europe: How To Make Your Silverlight 4 Application World Ready

Going to TechEd Europe 2010 in Berlin ? Come and see my session (WEB307) How To Make your Silverlight 4 Application World Ready. This is the same session I'm doing at the 34th Internationalization and Unicode Conference (#IUC34, where it is called How To Achieve World-Ready Domination In Silverlight 4) and I did last night at the Silverlight UK User Group (where it was called Internationalizing Silverlight 4). Here's the abstract:-

So you've written your Silverlight application and you want it to work in another language ? Then this session is for you. World-Readiness is all of the work that a developer needs to do to globalize an application and make it localizable (i.e. capable of being localized). Whereas these concepts are well established in Windows Forms and ASP.NET, Silverlight is not only a cut-down version of the .NET Framework but also cross platform and client-side. In this session you will learn how to localize Silverlight applications using .resx files, download culture-specific resources on demand so that users only download resources for the culture they need, understand what System.Globalization types and properties Silverlight does not support and why, what globalization and font support you can expect on Windows and the Mac, what the Silverlight installation user experience is for non-English users and what language support you can expect from the Silverlight framework.

Currently rated 1.8 by 4 people

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

Posted by: guysmithferrier
Posted on: Thursday, September 16, 2010 at 5:35 PM
Tags:
Categories: Internationalization | Silverlight | Events
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Internationalizing Silverlight 4 Slides and Source Code

Thanks to everyone who came to the Internationalizing Silverlight 4 presentation at the Silverlight UK User Group last night. A particularly huge thanks to Mark Mann who provided a personalised and internationalized introduction to me. Never had something like this before and I was very impressed and touched. Best introduction ever.

Excellent chat in the pub afterwards too. Really enjoyed it ? thanks everyone.

The slides for the presentation are available at http://www.guysmithferrier.com/Downloads/I18NSilverlight.zip. The source code is at http://www.guysmithferrier.com/Downloads/I18NSilverlightSource.zip.

Ian Smith took a video of the presentation which will be posted soon.

Be the first to rate this post

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

Posted by: guysmithferrier
Posted on: Thursday, September 16, 2010 at 10:51 AM
Tags:
Categories: Internationalization | Silverlight | Events
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 4

When Silverlight 2 was released I wrote a short document comparing the classes in the Silverlight System.Globalization namespace with those of the .NET Framework's same namespace. Last year I updated it for Silverlight 3 and now I have done the same again for Silverlight 4. Before you get too excited, however, the System.Globalization classes and their methods and properties in Silverlight 4 have not changed since Silverlight 3. That is not to say that there aren't internationalization changes in Silverlight 4 (right-to-left support being a very welcome addition), just that the classes themselves have not changed (not even to include TextInfo.IsRightToLeft). You can download the document here.

Currently rated 3.0 by 1 people

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

Posted by: guysmithferrier
Posted on: Thursday, September 09, 2010 at 3:42 PM
Tags:
Categories: Silverlight | Internationalization
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Updated: How To Give Great Presentations

A few years ago I wrote a paper on "How To Give Great Presentations". Most of the information in this document is relatively timeless and so it needs little updating. I have uploaded an updated copy now which contains a few updates for more recent technologies referenced in the document as well as a few additional sections. The majority of the document is unchanged (it increased from 25 pages to 28 pages) but if you use it as a reference then you should download the updated copy.

Be the first to rate this post

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

Posted by: guysmithferrier
Posted on: Friday, September 03, 2010 at 4:22 PM
Tags:
Categories: Miscellaneous - Other
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

DDD Dublin Call For Speakers

DDD Dublin (the free community driven, one day conference) will be held on Saturday 9th October 2010. The Call For Speakers is now open and closes on 13th September 2010 followed by session voting and then the agenda being announced on Tuesday 21st September 2010. 'Reasonable' T&E for speakers are being covered. If you are part of the UK community and are keen to start speaking at bigger events this is a great opportunity.

Be the first to rate this post

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

Posted by: guysmithferrier
Posted on: Friday, September 03, 2010 at 12:52 PM
Tags:
Categories: DDD | Events
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

PublicResourceCodeGenerator now works with Visual Studio 2010

I have updated the PublicResourceCodeGenerator (and all of the other code generators) so that it installs and works with Visual Studio 2010 (as well as Visual Studio 2008). The PublicResourceCodeGenerator is used to create Strongly Typed Resource Classes with a public class and a public constructor so that resx files can be used with Silverlight (you can read all about these code generators here). You can download an MSI/EXE and/or the source code (for Visual Studio 2010, 2008 and 2005) here.

Currently rated 4.3 by 3 people

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

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

.NET Internationalization Visual Studio 2010 Source Code Available

The source code for my .NET Internationalization book is now available for Visual Studio 2010. Versions are still available for Visual Studio 2008, Visual Studio 2005 and Visual Studio 2003 but the version for Visual Studio 2010 is the only one that I will be updating from here on (until the next release of Visual Studio).

Currently rated 5.0 by 2 people

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

Posted by: guysmithferrier
Posted on: Wednesday, September 01, 2010 at 6:11 PM
Tags:
Categories: .NET Internationalization Book
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed